No such thing as a small change | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
How about a two-stage approach? First, peel off your units:
Then proceed with the more standard problem of recognizing a number. See:
Normalizing your input in this way can be a powerful trick that allows you to more clearly identify and deal with your edge cases. Unless performance is absolutely stupendously crucial there is no reason to implement a monolithic regexp that handles every possibility. Matt In reply to Re: Identifying and parsing numbers
by mojotoad
|
|