Insert Character in Filename

A swapping-ground for Regular Expression syntax

Insert Character in Filename

Postby mtolleson » Thu Aug 24, 2023 6:22 pm

My filenames all contain the string "to x", where x=a digit.

I want to insert a zero before the digit:

From: "to x"
To: "to xx", where the first x=0.

Noob here, and thanks.

Mark
mtolleson
 
Posts: 2
Joined: Thu Aug 24, 2023 6:09 pm

Insert "0" between "to " and "1-digit"

Postby Luuk » Fri Aug 25, 2023 8:06 am

With a checkmark inside for "v2", the "Match" and "Replace" can look like...
\b(to )(\d)(?!\d)/g
${1}0$2
Luuk
 
Posts: 706
Joined: Fri Feb 21, 2020 10:58 pm

Re: Insert Character in Filename

Postby mtolleson » Fri Aug 25, 2023 2:50 pm

It works beautifully, thanks.

Mark
mtolleson
 
Posts: 2
Joined: Thu Aug 24, 2023 6:09 pm


Return to Regular Expressions