Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Regexp::Common not so common?

by eosbuddy (Scribe)
on Aug 14, 2008 at 14:38 UTC ( [id://704359]=note: print w/replies, xml ) Need Help??


in reply to Regexp::Common not so common?

You can't concatenate regexp the way you did, but you can look for repetitions. Since you're looking for matching parenthesis, you need non-greedy quantifiers. I would use something of this sort (unless you have a specific reason to concatenate them as you did):
#!/usr/bin/perl use strict; use warnings; my $test = "I am here {there} and {everywhere} but not below and above +"; print "$test\n"; $_ = $test; if (/\{(.*?)\}(.*)\{(.*?)\}/) { print "Success $1 $3\n"; }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (5)
As of 2024-03-28 16:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found