Explanation:
(2) starts with a 2
[0]+ one or more zeros
[^0] any carachter not zero
The parts are tagged with ().
The first subpattern is $1, the second $2 etc.
works as well, but I'm not sure if that is a feature or a bug. Anyway, take it as you will, I just figured if you're new to Regex's you should know about the ability to just capture what you want.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.