Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Re: split question

by chipmunk (Parson)
on Sep 08, 2001 at 18:36 UTC ( #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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://111161]
[LanX]: I've already outlined. you might want to add a link
[LanX]: oopp ssorry ...
[LanX]: ... thought it's a root post
[ww]: That's a [id://1179775 beaut], all right!
[ww]: beaut

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (8)
As of 2017-01-17 18:18 GMT
Find Nodes?
    Voting Booth?
    Do you watch meteor showers?

    Results (158 votes). Check out past polls.