Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: If I'm matching a pattern wy does a + sign make things crazy?

by AnomalousMonk (Archbishop)
on May 05, 2020 at 21:57 UTC ( [id://11116497]=note: print w/replies, xml ) Need Help??


in reply to If I'm matching a pattern wy does a + sign make things crazy?

($mres) = ($res =~ m/(<a href=\"https:\/\/www.example.com\/foodbanks\/.*<\/a>)/im);

Also WRT regexes: In the code above quoted from the OP, note that the  . (dot) operators in  www.example.com will match anything (except newlines (unless the  /s modifier is asserted)), so e.g.,

c:\@Work\Perl\monks>perl -wMstrict -le "print 'match' if 'wwwXexampleYcom' =~ /www.example.com/; " match
The dot (and any other regex metacharacters that may be present) should be escaped appropriately.


Give a man a fish:  <%-{-{-{-<

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2024-04-19 12:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found