Skip to main content
B.Cain
Participant
January 7, 2015
Answered

Find/Change Grep only finds one instance per paragraph, where am I going wrong?

  • January 7, 2015
  • 3 replies
  • 492 views

Hi,

I've been using a Find/Change Grep to find any price with a comma and change that comma to a thin space (Newspaper's editorial style).

But the Grep only finds the first instance of this per paragraph.

Sample text...

"$200,000 $200,000 $200,000.

text at start of paragraph $200,000

$200,000 text at end of paragraph

tab     $200,000."

In the sample the grep would miss the second and third price on the first line.

I've been using...

Find...

(?<=\$)(\d{3})\,?(\d{3})

also tried (\$\d{3})\,?(\d{3})

Change to...

$1~<$2

Is there anything I can add to find these last two prices?

I've been using this in combination with Batch Find Replace script, so different greps are set up for 5,6 and 7 digit numbers that start with $.

Thanks.

This topic has been closed for replies.
Correct answer Chinnadk

try this,

(?<=[$])(\d{3}),?(\d{3})

3 replies

B.Cain
B.CainAuthor
Participant
January 8, 2015

Thanks champs,

Both responses worked.

Chinnadk
ChinnadkCorrect answer
Legend
January 8, 2015

try this,

(?<=[$])(\d{3}),?(\d{3})

Legend
January 8, 2015

Try this,

Find what: (?<=\x{0024})(\d{3})\,?(\d{3})

Change to: $1~<$2

Vandy