Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: String parsing

by ysth (Canon)
on Jan 05, 2004 at 12:10 UTC ( [id://318823]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $tempstr = $str;
    # get rid of () around status
    $tempstr =~ s/^([^(:]+)\(([^)]+)\)/$1$2/;
    # grab the status and anything in parentheses
    @needed = $tempstr =~ /(^[^:]+|(?<=\()[^)]+(?=\)))/g;
    
  2. or download this
    @needed = $_ =~ /(^[^:]+|(?<=\()[^)]+(?=\)))/g;
    $needed[0] =~ y/()//d;
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (7)
As of 2024-03-28 09:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found