Sublime Forum

Regex, insert space after regex match

#1

Is it possible to add a space after a regex match. I want to add a space after an underscore and two numbers. I did a match using (_\d\d) but can’t figure out how to add a space after the match. Any options is good for me. basically i have test_22test_23test_24. I would like to keep my text as is but a space after. So looks like " test_22 test_23 test_24" Thanks in advance!

0 Likes

#2

Assuming that (_\d\d) is your full regex, a replacement of $1 with a space after it will tell the replacement to replace the matched text with the text it found (the $1) plus the space you added to the end.

0 Likes