I need (case insensitive) all matches of several variants of the word - except for one - including unknowns.
I want to
accept
acceptance
acceptable
accepting
... but not "acceptance." The employee used it when he meant "exception". A lot of.
Since I cannot foresee options (or typos), I need to allow things like "acceptjunk" and "acceptMacarena"
I thought I could do it with a negative look, but it did not produce the results that I need
grep -iE '(?!acception)(accept[a-zA-Z]*)[[:space:]]' file
The trick is that I can accept strings (har) containing "acception", provided that the other words match. For example, this line in order corresponds to:
Acceptance of the inevitable is acceptance.
... grep grep -v :
grep -iE '(accept)[a-zA-Z]*[[:space:]]' | grep -vi 'acception'
, . a-zA-Z, , grep -i, . , , - ... . ?
.
PS: grep, bash - awk, , ().
PPS: , https://regex101.com/ , grep.