Copy link to clipboard
Copied
Trying to figure out GREP find and change code for a particular character in this case below an
en dash: (~=) to the end of the paragraph
Arch A. Moore, III – Executive Vice President, Middleburg Market Executive
to
Arch A. Moore, III – Executive Vice President, Middleburg Market Executive
This is probably a very ease one. Appreciate the help if you can give it.
Thanks,
Scott
Easy with a GREP Style, no need for search and replace.
The GREP expression is (?<=–).+
That’s an en-dash before the closing parenthesis. In this example the en dash is not italicized.
(?<=
This is a positive look behind. It finds text that follows the specified character or characters.
–
The en dash for the positive look behind to find.
)
The closing parenthesis for the positive look behind expression
.
Wildcard, meaning any character
+
Repeat one or more times. This is applied to the wildcard, meaning the
...Copy link to clipboard
Copied
Easy with a GREP Style, no need for search and replace.
The GREP expression is (?<=–).+
That’s an en-dash before the closing parenthesis. In this example the en dash is not italicized.
(?<=
This is a positive look behind. It finds text that follows the specified character or characters.
–
The en dash for the positive look behind to find.
)
The closing parenthesis for the positive look behind expression
.
Wildcard, meaning any character
+
Repeat one or more times. This is applied to the wildcard, meaning the expression will find any characters after an en dash up to the end of the paragraph.
Copy link to clipboard
Copied
–\h\K.+
(^/)
Copy link to clipboard
Copied
Thanks Obi-Wan!
Copy link to clipboard
Copied
Thanks Scott!
Copy link to clipboard
Copied
Or even a nested style, using None through the first dash, and italic through the first forced line break.