Is there a way to use regex to reformat a string?
I’ve a string like this AEY4293 and I want to add a dash between letters and numbers, like this AEY-4293.
I was trying to find something like s/pattern/replacement/, but I couldn’t find it.
I can select the blocks using /(\w+)(\d+)/ so if I could give to a pattern to reformat the text like \1-\2 it would be great.
Thanks!
1 Answer