Help with a simple regex

  • Thread starter Thread starter Brian Henry
  • Start date Start date
B

Brian Henry

Hi everyone,

I never have worked much with regex (trying to learn it now myself) but I
have a simple problem that I need to solve..

Say I have numbers like this

00023432-234
0000000034112-23
00001200034-34
00334-00034
33434-34
000001-343

What I need the expression to do is remove the hyphen, and take off any
leading zeros from the left side so the results look like this.

23432234
3411223
120003434
33400034
3343434
1343

Could someone give me some advice or help with this? thanks
 
does this pattern seem like it will work for you guys? this is on a
regex.replace function with the replacement string as string.empty

^0*|-*|

thanks
 
Back
Top