^[0]+([1-9][0-9]{1,})$NOTE: will NOT match a number that doesn't have leading zeroes
Thursday, December 2, 2010
Strip leading zeroes using regex
Doesn't actually "strip", rather captures the non-laeding-zero number. Works only on a string that only contains numbers, and is compatible with ancient regex versions.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment