Simon Guo
Simon Guo

Reputation: 2926

Regular Expression Number Followed by Group Matching in Textmate

Now I have few numbers for example

4723
4102
2160
8502

I want to add a 0 in the middle, to replace them as:

47023
41002
21060
85002

So what I did was matching:

^(\d{2})(\d{2})

replacing:

$10$2

But it doesn't give me correct result. Wondering how to escape the 0 in between $1 and $2? Much Thanks.

Upvotes: 2

Views: 171

Answers (1)

dan radu
dan radu

Reputation: 2782

I guess the regex parser gets confused with $10. Try ${1}0${2}. Test: http://regex101.com/r/xT3zT7

Upvotes: 1

Related Questions