add leading 0 to one digit files strangeness

A swapping-ground for Regular Expression syntax

add leading 0 to one digit files strangeness

Postby Jou » Tue Jan 25, 2011 11:08 pm

Does not work:
RegEx(1) with "include file extension"
(^\d\.)
0\1

results in
1.doc -> 01..doc
2.doc -> 02..doc
3.doc -> 03..doc

Does work:
(^\d)(\.doc)
0\1

results in
1.doc -> 01.doc
2.doc -> 02.doc
3.doc -> 03.doc

Is the bug in BRU or in my brain? If it is in my brain, where is it?
Jou
 
Posts: 1
Joined: Tue Jan 25, 2011 11:03 pm

Re: add leading 0 to one digit files strangeness

Postby Stefan » Sat Feb 12, 2011 7:23 pm

I didn't understand it either.

just use
^(\d)\.
or
^(\d\..+)
or
^(\d\..doc)
or
^(\d)

or best use RegEx with "Include Ext." unchecked.

To match/filter the right files you may use "Selection(12)" with "*.doc"
Unfortunately we can't use an regex here like "\d\.doc"
Stefan
 
Posts: 736
Joined: Fri Mar 11, 2005 7:46 pm
Location: Germany, EU


Return to Regular Expressions