Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

GREP find/replace

New Here ,
Jul 26, 2017 Jul 26, 2017

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

Screenshot 2017-07-26 14.05.38.png

Arch A. Moore, III – Executive Vice President, Middleburg Market Executive

to

Arch A. Moore, IIIExecutive Vice President, Middleburg Market Executive

This is probably a very ease one. Appreciate the help if you can give it.

Thanks,

Scott

1.4K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jul 26, 2017 Jul 26, 2017

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

...
Translate
Community Expert ,
Jul 26, 2017 Jul 26, 2017

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.

Screen Shot 2017-07-26 at 11.12.57 AM.png

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 26, 2017 Jul 26, 2017

–\h\K.+

(^/) 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 26, 2017 Jul 26, 2017

Thanks Obi-Wan!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 26, 2017 Jul 26, 2017

Thanks Scott!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jul 27, 2017 Jul 27, 2017
LATEST

Or even a nested style, using None through the first dash, and italic through the first forced line break.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines