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

Simple text GREP... I think....

Explorer ,
Jul 10, 2025 Jul 10, 2025

Hi there. I've used a few tasty GREP expressions that the good folk of this community have helped with over the years, but I must confess I've never grasped it well enough to improvise or create my own...

I'm working through a long list of text and have a line of new prices for products in a specific style (let's call it NOW price). I'd like to insert the text 'Now only' at the start of all of these rows. Previously I've added that as bullet text which works a treat on it's own row, but as soon as I place this text onto a new line that will disappear so it needs to be the actual wording 'NOW ONLY' like below.

Currently (prices all differ so just an example and there are other prices in the document so I'll apply it only to the style in question):

£29.99

Should be:

NOW ONLY £29.99

TOPICS
How to , Type
156
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 10, 2025 Jul 10, 2025

Well the bullet should be paragraph style - so that when the text moves to the next line it should retain the style of the paragraph style. 

 

But if you're looking to put in NOW ONLY at the start then 

 

Find

^(?=£[\d,\.])+

change to

NOW ONLY 

 

(with a space at the end) 

 

Any price at beginning of a sentence will update 

 

£29.99

£2,999

£2,999.99

 

this is the part that catches the price after a £

£[\d,\.]+

 

^ is th start of a sentence

 

And wrapping it in 

(?=) means it will ignore it

 

So

...
Translate
Community Expert ,
Jul 10, 2025 Jul 10, 2025

Well the bullet should be paragraph style - so that when the text moves to the next line it should retain the style of the paragraph style. 

 

But if you're looking to put in NOW ONLY at the start then 

 

Find

^(?=£[\d,\.])+

change to

NOW ONLY 

 

(with a space at the end) 

 

Any price at beginning of a sentence will update 

 

£29.99

£2,999

£2,999.99

 

this is the part that catches the price after a £

£[\d,\.]+

 

^ is th start of a sentence

 

And wrapping it in 

(?=) means it will ignore it

 

So effectively, it finds the price and ignores and inserts the text insertion at the beginning 

 

^(?=£[\d,\.])+

 

The + means just match longest string 

even if it is 

£2,999,999,999,999.99

 

 

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
Explorer ,
Jul 10, 2025 Jul 10, 2025
LATEST

Magic! Thank you Eugene. 🙂

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