Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^2: How to write a regular expression to extract a number from an embedded string?

by pbeckingham (Parson)
on Jul 28, 2004 at 16:54 UTC ( [id://378112]=note: print w/replies, xml ) Need Help??


in reply to Re: How to write a regular expression to extract a number from an embedded string?
in thread How to write a regular expression to extract a number from an embedded string?

Please be aware that your suggestion of using

.*
will greedily include everything to the end of the string. The OP specifically states 8 digits, with possible whitespace breaking the digits into groups of 4.

While your suggestion works on your test data, it will not work on certain other data.

  • Comment on Re^2: How to write a regular expression to extract a number from an embedded string?
  • Download Code

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2024-04-19 01:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found