Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Regex and leading zeros in numbers

by Happy-the-monk (Canon)
on Mar 24, 2004 at 16:25 UTC ( [id://339452]=note: print w/replies, xml ) Need Help??


in reply to Regex and leading zeros in numbers

You did not tell us what the files look like. Anyway:

  • Extract a series of digits: m/(\d+)/
  • Extract a series of digits, throw away leading "0": m/0(\d+)/

You can compare numbers numerically with the == operator, so you do not need to care about leading zeros.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://339452]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2024-04-23 15:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found