Reply To: Grep automation

#82482
Peter Kahrel
Participant

Assuming that two consecutive words with initial capitals are names, you can do what you want with two GREP expressions:

1. ‘Paul’ followed by and and another name: \u+(?=\u+\u)

This one reads ‘find a name \u+ followed by (?= a space and a name \u+ followed by a space and a name.

2. Then find Sue Craft: \u+\u+

The naive assumption is that a name is matched by an upper-case letter followed by any lower-case letters, which is too simple, so you’ll have to refine the pattern to include double-barrelled names, prefixes, etc.

Peter

This article was last modified on March 1, 2016

Comments (0)

Loading comments...