Page 1 of 1

Regular expression script

Posted: 13 May 2012 19:07
by zer0
I need a script to rename a section of 3 digits enclosed by dots (say .234.) into something like this ".X12Y34." (letters and digits are examples). Using this script line, I can insert the "X1" part, but struggling with the "Y" since it would need adding \w\d as the string would now be 1 letter and 4 digit long.

Code: Select all

rename r , '\.(\d\d\d)\. > .X1$1.' ;
Any help please? Cheers! :biggrin:

Re: Regular expression script

Posted: 13 May 2012 19:20
by highend

Code: Select all

rename r , '\.(\d)(\d\d)\. > .X1$1Y$2.' ;

Re: Regular expression script

Posted: 13 May 2012 19:28
by zer0
highend wrote:

Code: Select all

rename r , '\.(\d)(\d\d)\. > .X1$1Y$2.' ;
Thanks very much :)