#1 2009-01-04 12:19

CeeJay
Member
Registered: 2009-01-04
Posts: 2

Delete until the first digit

Hi - happy new year,

Is it possible to do a remove rul - that removes all letters until it meets the first digit,

example:

aklsdjask1test.doc   should be renamed to 1test.doc
ahs1topic.xls  should be renamed to 1topic.xls
3years.doc should be 3years.doc.

is this possible???

Thanks

CJ

Offline

#2 2009-01-05 17:58

Andrew
Senior Member
Registered: 2008-05-22
Posts: 542

Re: Delete until the first digit

Should be possible with RegEx. I'm sure someone much more well-versed in the subject than me will tell you how. smile

Offline

#3 2009-01-05 17:59

SafetyCar
Senior Member
Registered: 2008-04-28
Posts: 446
Website

Re: Delete until the first digit

Try with the RegEx rules:

Expresion: ^(\w*?)(\d)
Replace:    $2


If this software has helped you, consider getting your pro version. :)

Offline

#4 2009-01-05 19:17

eR@SeR
Senior Member
From: Земун, Србија
Registered: 2008-01-23
Posts: 353

Re: Delete until the first digit

As I'm not experienced well enough with RegEx I tried modifying these ones Renamer:Remove track numbers but failed sad

Your RegEx do the work (nice one smile) and I'll just submit this modified one as it removes any non digit from start of line, till first digit. Someone will need it perhaps.

Expression: ^(\D*?)(\d)
Replace: $2

I used \A instead ^ too, and it seems that's the same. Is it? Same question is for \Z and $...

It will be good if it could be something like "RegExes" button, similar like Scripts in PascalScript rule, or pop up window like in Insert and Replace rules (Meta Tags), so every user can use already "served" regular expressions. Newly created will be updated etc. Sorry for posting it here, but as we speak about it... roll

P.S. I'll submit mine RegEx in ReNamer: Examples of Regular Expressions. I'll recommend you to do too, for future reference. Thanks wink


TRUTH, FREEDOM, JUSTICE and FATHERLAND are the highest morale values which human is born, lives and dies for!

Offline

#5 2009-01-05 23:20

CeeJay
Member
Registered: 2009-01-04
Posts: 2

Re: Delete until the first digit

Thanks for your help:

eR@SeR's solution did the trick for me....

Cheers,

Carsten

Offline

#6 2009-01-07 21:50

krtek
Senior Member
From: Łódź (Poland)
Registered: 2008-02-21
Posts: 262

Re: Delete until the first digit

eR@SeR wrote:

I used \A instead ^ too, and it seems that's the same. Is it? Same question is for \Z and $...

Yup, they're complete sinonims... smile


Regular Expressions are not as hard to understand as you may think. Check ReNamer's manual or nice Regular Expressions tutorial for more info and start to use full power of applications that use them (like ReNamer, Mp3Tag and so on).

Offline

Board footer

Powered by FluxBB