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

Re^3: Help with regular expression

by graff (Chancellor)
on Nov 13, 2014 at 02:26 UTC ( [id://1107044]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Help with regular expression
in thread Help with regular expression

toolic's solution is the right answer for the few examples you gave, but since you haven't said anything about the larger context of strings you might be getting as input, how should the following be treated by your intended regex?
(foo 12) foo 12 bar foo 12, bar 34 Foour score and 12 years ago there were 34 bars in this town.
All the above would fail, given toolic's very tight use of anchors (^ and $). If that's what you want, then the problem is solved.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (6)
As of 2024-04-25 14:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found