Regular expression script

Discuss and share scripts and script files...
Post Reply
zer0
Posts: 2676
Joined: 19 Jan 2009 20:11

Regular expression script

Post 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:
Reporting a bug? Have a wish? Got a question? Use search - View roadmap - FAQs: Forum + XY site
Windows 7/10
Always using the latest stable two-decimal build

highend
Posts: 14940
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Regular expression script

Post by highend »

Code: Select all

rename r , '\.(\d)(\d\d)\. > .X1$1Y$2.' ;
One of my scripts helped you out? Please donate via Paypal

zer0
Posts: 2676
Joined: 19 Jan 2009 20:11

Re: Regular expression script

Post by zer0 »

highend wrote:

Code: Select all

rename r , '\.(\d)(\d\d)\. > .X1$1Y$2.' ;
Thanks very much :)
Reporting a bug? Have a wish? Got a question? Use search - View roadmap - FAQs: Forum + XY site
Windows 7/10
Always using the latest stable two-decimal build

Post Reply