Page 1 of 1

there must be a regex way to do this

Posted: Wed Oct 21, 2015 2:05 pm
by lklawrie
I am just not that expert in regular expressions.

I want to search for

City=<word>.<word>.<word>

where the number of words is unknown.

and replace the . with space.

Posted: Wed Oct 21, 2015 4:01 pm
by ben_josephs
Do you want every dot that's immediately preceded and followed by words to be replaced by a space?

If so, try
Find what: (\w)\.(\w)
Replace with: $1_$2 [Replace the underscore with a space]

[X] Regular expression

Replace All

Posted: Wed Oct 21, 2015 4:10 pm
by ben_josephs
Or
Find what: \b\.\b
Replace with: _ [Replace the underscore with a space]

Posted: Wed Oct 21, 2015 4:12 pm
by lklawrie
There are numbers in the file too. I don't want their . to be replaced. Only on the lines that start with "city="

Posted: Wed Oct 21, 2015 6:36 pm
by ben_josephs
Find what: ^(City=.*)\b\.\b
Replace with: $1_ [Replace the underscore with a space]

[X] Regular expression

Replace All -- do this repeatedly until it beeps