How add "-" between letters and digits

A swapping-ground for Regular Expression syntax

How add "-" between letters and digits

Postby wentys » Sun Oct 26, 2014 3:02 am

from:
lettersdigits.ext
to:
letters-digits.ext

Unfortunately, the number of letters and digits are different, eg:
a1.ext
abc555.ext
ab55555.ext

but always first are letters
wentys
 
Posts: 1
Joined: Sun Oct 26, 2014 2:48 am

Re: How add hyphen dash minus between letters and digits

Postby Stefan » Sun Oct 26, 2014 4:10 pm

FROM:
a1.ext
abc555.ext
ab55555.ext

TO:
a-1.ext
abc-555.ext
ab-55555.ext

USE:

RegEx(1)
Match: ([a-z]+)(\d+)
Repla: \1-\2


 
Stefan
 
Posts: 736
Joined: Fri Mar 11, 2005 7:46 pm
Location: Germany, EU

Re: How add "-" between leters and digits

Postby Admin » Wed Nov 05, 2014 5:15 am

@wentys, did the suggestion provided by Stephan work OK? thanks
Admin
Site Admin
 
Posts: 1504
Joined: Tue Mar 08, 2005 8:39 pm


Return to Regular Expressions