Help with a simple regex

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
 
B

Brian Henry

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top