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

Re: regex on a line

by CukiMnstr (Deacon)
on Aug 01, 2002 at 16:18 UTC ( [id://186822]=note: print w/replies, xml ) Need Help??


in reply to regex on a line

hm. let's see: i don't think you need the non-backreferencing parentheses around 'Update Status'. also, when you are looking for $view, you get $1 again, and that is still 'open'.

you might get what you want with a simple split(), but maybe you have those '\s*' because sometimes you don't have whitespace between the fields...

you could use only one regex, and with it capture both fields:

m/^Update Status:\s*?(\w+)\s*?\(\w+:?\s*?(\w+)\)/

and then:

($target, $view) = ($1, $2);

hope this helps,

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2024-03-28 15:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found