Search with regular expression to remove zeros

I am a newb when it comes to regular expressions and looking for an answer.

I have a list of 8000 files... some have leading zeros, some do not... example

080-000411-2009
090-001144-2010
52-011-2009

I want to remove all leading zeros in both the first section and second... but leave the year alone... is this possible?

(I'm looking to do a find and replace in notepad++ using an expression)
hzrdc2Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
snoyConnect With a Mentor Commented:
Hi,

Do this :
First : Remove the first 0 (Ctrl+H) :
$0
Replace "" [Leave blank]
Do it again if there is some number which starts with 00 then they will be fixed.
Second : Remove The 0 after there - (Ctrl+H) :
$-0
Replace "-"

Enjoy!
H.Y.
www.w3consulting.ma
0
 
snoyCommented:
0
 
FDiskWizardConnect With a Mentor Commented:
in Search and Replace dialog, make sure Regular Expression is checked.

Two methods, and I'm assuming a single zero at the beginning:

Find what: ^(0)(.*)$
Replace with: \2

Or simply:
Find what: ^(0)
Replace with: {BLANK,NOTHING...}

If multiple leading zeros:

Find: ^[0*]
Replace with: Nothing....
0
[Webinar] Improve your customer journey

A positive customer journey is important in attracting and retaining business. To improve this experience, you can use Google Maps APIs to increase checkout conversions, boost user engagement, and optimize order fulfillment. Learn how in this webinar presented by Dito.

 
käµfm³d 👽Commented:

Find:
    0+(\d+-)0+(\d+-)(\d+)

Replace:
    \1\2\3

Open in new window

0
 
käµfm³d 👽Connect With a Mentor Commented:
Correction:
Find:
    0*(\d+-)0*(\d+-)(\d+)

Open in new window

0
 
hzrdc2Author Commented:
This is why I love the internet... tried all three and they are all valid.

kudo's to you all... added to my knowledge today!
0
All Courses

From novice to tech pro — start learning today.