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

Re^2: regexp help -- grab almost a whole string

by Polyglot (Monk)
on May 20, 2009 at 03:27 UTC ( #765094=note: print w/ replies, xml ) Need Help??


in reply to Re: regexp help -- grab almost a whole string
in thread regexp help -- grab almost a whole string

I'm not certain why it must be a "single regexp", but this will do the job in a single line of execution:

if ($if_desc =~ /(DHEC)\.?(\w+)/) {$circuit_id = "$1$2"};

Would this satisfy your requirement?

Blessings,

~Polyglot~


Comment on Re^2: regexp help -- grab almost a whole string

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2014-11-20 23:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (102 votes), past polls