Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

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

by Polyglot (Pilgrim)
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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2017-04-30 09:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (535 votes). Check out past polls.