Enter 0 when you have 10 numbers

2

I have the following sequence:

3531399402

It has 10 numbers, with this regex I can list these occurrences:

^\d{10}$

I'm using a text editor and I need to give a replace on those instances and insert a 0 before getting like this:

03531399402

How can I do it?

    
asked by anonymous 29.05.2017 / 17:12

1 answer

5

You must enter a capture group. Home So you can identify replace through the group and use it again with what you want to insert. Home I suggest you try changing your regex to:

^(\d{10})$

And use for replace:

0$1

This indicates that replace must be done by entering 0 and capture group 1 which in this case are the 10 digits you mentioned in the question.

    
29.05.2017 / 17:41