Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: how to to find the "/" in a string

by davido (Archbishop)
on Aug 31, 2012 at 18:49 UTC ( #991073=note: print w/replies, xml ) Need Help??


in reply to how to to find the "/" in a string

The answer to the specific question you ask can be found in the first section of perlrequick:

Finally, the // default delimiters for a match can be changed to arbitrary delimiters by putting an 'm' out front:

"Hello World" =~ m!World!; # matches, delimited by '!' "Hello World" =~ m{World}; # matches, note the matching '{}' "/usr/bin/perl" =~ m"/perl"; # matches after '/usr/bin', # '/' becomes an ordinary char

But so you do less work up front, and endure less pain in the longrun, you might benefit from one of the many HTML parsers on CPAN.


Dave

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://991073]
help
Chatterbox?
and the grasshoppers chirp...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2017-11-21 06:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (296 votes). Check out past polls.

    Notices?