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

How will my regular expression match?

by hv (Parson)
on Jul 04, 2004 at 16:57 UTC ( #371722=perltutorial: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
      ($match) = "The longest word" =~ /(\w+)/;
      print $match;
    
  2. or download this
      ($match) = "Mrs Smith" =~ /(Mr|Mrs)/;
      print $match;
    
  3. or download this
      ($match) = "/foo/bar" =~ m[.*/(.*)];
      print $match;
    
  4. or download this
      ($match) = "foo/bar/baz" =~ m[.*?/(.*)];
      print $match;
    
  5. or download this
      ($outer, $inner) = "/foo/bar" =~ m[(/(.+))*];
      print $inner;
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (9)
As of 2014-09-30 23:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (386 votes), past polls