GREP expression in paragraph style
Hi,
I’m try to find a GREP expression to include in a paragraph style to capitalise (via style GREP) some words.
This is the pattern:
lastName1 Name1, y Name2 lastName2. Year.
I want to apply a character style to both lastName.
The first one is easy, but I have problems with the second one.
These are my tries:
- (?<=, y )\u\w+ //finds Name2
- (?<=y [^, ])\w+(?=\. (\d+)\.) //finds “astName2”
- (?<=y [^, ])\u\w+(?=\. (\d+)\.) //No results
- (?<=, y (\u\w+) )\u\w+ //No results
I’ve tried many but failed.
One thing to have in mind: lastName2 can have a hyphen in between (eg. Martinez-Ramirez).
Thank you all
