regex - grep for words ending in 'ing' immediately after a comma -
i trying grep files lines word ending in 'ing' after comma, of form:
... gave dog bone, showing great generosity ... ... man, having no home ...
but not:
... great place, having time ...
i find instances 'ing' word the first word after comma. seems should doable in grep, haven't figured out how, or found similar example.
i have tried
grep -e ", .*ing"
which matches multiple words after comma. commands like
grep -i -e ", [a-z]{1,}ing" grep -i -e ", [a-z][a-z]+ing"
don't expect--they don't match phrases first 2 examples. (or pointers better tool) appreciated.
try ,\s*\s+ing
matches first 2 phrases, doesn't match in third phrase.
\s
means 'any whitespace', * means 0 or more of that, \s
means 'any non-whitespace' (capitalizing letter conventional inverting character set in regexes - works \b
\s
\w
\d
), +
means 'one or more' , match ing
.
Comments
Post a Comment