Skip to main content
Participating Frequently
January 18, 2023
Answered

GREP query

  • January 18, 2023
  • 2 replies
  • 764 views

Hi all,

 

I am looking for a GREP for:

Search for: a paragraph return and anything upto </bo> 

Replace with paragraph return and found text (minus the </bo>) and apply character style 'bold'

I will then use this to apply 'italic' to </it> etc.

 

Many thanks!

This topic has been closed for replies.
Correct answer brian_p_dts

You don't need to search for the return. Use beginning of paragraph key instead. Your find is: ^(.+)<\/bo>

Your change is: $1 with the applied character style. Change bo to it for italics. 

2 replies

Participating Frequently
January 18, 2023

Thank you so much! I'm hoping to somehow put these into a script to run. Is this something you would be able to help with please?

brian_p_dts
Community Expert
Community Expert
January 18, 2023

You can use the FindChangeByList script that comes installed in your Application scripts panel. Just be sure to escape your \ a second time: \\

Participating Frequently
January 18, 2023

Hopefully last question..I have just found I have some text in a paragraph <italic></italic> in the middle of a paragraph. How would I search and replace this please? Thank you again, you have saved me many hours work!

brian_p_dts
Community Expert
brian_p_dtsCommunity ExpertCorrect answer
Community Expert
January 18, 2023

You don't need to search for the return. Use beginning of paragraph key instead. Your find is: ^(.+)<\/bo>

Your change is: $1 with the applied character style. Change bo to it for italics.