0

So, for example, I have this list:

10text
11text
12text
13text
14text
15text
16text
17text
18text
19text

Now I need to copy this and make it all into the 20-29 and 30-39 range with a Regex.

So only the very first 1 needs to be changed into a 2 and a 3 etc.

I can't seem to figure out what the regex is.

I tried: 1.text 1*text

Now I have been doing some reading and probably because it ain't in my native language it is still magic to me.

http://www.ntu.edu.sg/home/ehchua/programming/howto/regexe.html

https://www.regular-expressions.info/tutorial.html

http://2017.compciv.org/guide/topics/end-user-software/atom/how-to-use-regex-atom.html

Reference - What does this regex mean?

https://stackoverflow.com/tags/regex/info

What was I hoping for

When I fill in this in the search field:

1*text

and this in the replace field:

2*text

then on pressing change all the list becomes

20text
21text
22text
23text
24text
25text
26text
27text
28text
29text
purple11111
  • 653
  • 5
  • 18

1 Answers1

2

I don't know exactly what you are trying to do here, but if you want to convert 1xtext to 2xtext, then try searching for this pattern:

^1

and then replace with just 2. Or, more generally, to match something like (1xtext) you could try using the pattern \b1, and again replace with 2.

Tim Biegeleisen
  • 387,723
  • 20
  • 200
  • 263
  • Does this mean that there can't be any content in front of the `1xtext` so lets say when it is encapsulated with `(1xtext)`? Atom.io is not responding to the regex. – purple11111 Apr 25 '19 at 15:21