Is there a regular expression for the following that matches characters in a character set but only once? In other words, once a character is found, remove it from the set.
If grep cannot do this, is there a built-in utility which can?
Example:
Characters to match only once: spine
Input:
spine
spines
spin
pine
seep
spins
Output:
spine
spin
pine
EDIT:
There are many ways to achieve this output (one example below), but I'm looking for a way to do this without having to customize the command for each pattern I want to match.
grep '[spine]' input_file | grep -v 's.*s' | ... | grep -v 'e.*e'