Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Regexp::Common not so common?

by FunkyMonk (Chancellor)
on Aug 14, 2008 at 13:40 UTC ( [id://704348]=note: print w/replies, xml ) Need Help??


in reply to Regexp::Common not so common?

I don't believe you can join two regex's together using string concatenation. If you spell it out, it works:
$teststring =~ s/hello\s*$RE{balanced}{-parens=>'{ }'}\s*$RE{balanced} +{-parens=>'{ }'}/hi/; #teststring: start hi end

(Except you didn't have any capture parentheses in your original s///.)


Unless I state otherwise, all my code runs with strict and warnings

Replies are listed 'Best First'.
Re^2: Regexp::Common not so common?
by massa (Hermit) on Aug 14, 2008 at 14:34 UTC
    Yes, you can join two regexes together using ".". What you have to do is obey the error message and add
    use re 'eval';
    to your script. See re.
    []s, HTH, Massa (κς,πμ,πλ)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2024-04-23 06:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found