Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: split question

by chipmunk (Parson)
on Sep 08, 2001 at 18:36 UTC ( [id://111161]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $inLine = "RPC, rpc #001b, (1987)";
    my $year;
    if ($inLine =~ /\((\d+)\)/) {
    ...
      die "No year found in '$inLine'.\n";
    }
    print "Found year '$year' in '$inLine'.\n";
    
  2. or download this
    my $inLine = "RPC, rpc #001b, 1987";
    
    $inLine =~ /(#\d+[a-z])/;
    ...
    $inLine =~ /\((\d+)\)/;
    my $year = $1;
    print "Found year '$year' in '$inLine'.\n";
    
  3. or download this
    Found rpc num #001b in RPC, rpc #001b, 1987.
    Found year #001b in RPC, rpc #001b, 1987.
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (6)
As of 2024-03-28 16:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found