0

I have 2,5-3,5 3,5-4,5 ... and want 2.5-3.5 3.5-4.5

My "Find what" in Replace look like [0-9],[0-9]

But I cannot make "Replace with" \2.\1 to work. Nor does $2.$1.

This is clearly a simple task. What am I doing wrong?

Thanks

2
  • Unless you wanted to reverse the digits, you want the replacement to be \1.\2, not \2.\1. You probably knew that. Commented Jul 31, 2011 at 8:58
  • Is there like somebody out there who detests Notepad++ so much, he must silently vote to move every other Notepad++ question to Super User? It's almost always this one guy... Commented Jul 31, 2011 at 11:49

2 Answers 2

1

You need to specify groups to use replacement tags. I don't use notepad+, but if it's similar to other regex implementations \([0-9]\),\([0-9]\) should do the trick.

Sign up to request clarification or add additional context in comments.

2 Comments

If it is similar to other regex implementations (which it is, somewhat), those backslashes aren't supposed to be there.
@BoltClock: it depends on the default level of 'magic'. In VIM, for example, the slashes have to be there in the default magic setting.
0

Did you checked Regular Expression checkbox(Search mode) in Notepad search and replace dialog?

I have just tried, this will work just fine for your case.

Search string: (\d),(\d)

Replace string: \1.\2

If you want to be more precise you can search and replace like this

Search string: (\d),(\d)-(\d),(\d)

Replace string: \1.\2-\3.\4

End just for reminder here is picture where you have to check regular expression option

enter image description here

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.