Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Grepping out strings

by Anonymous Monk
on Feb 02, 2005 at 16:23 UTC ( #427316=note: print w/replies, xml ) Need Help??


in reply to Grepping out strings

If false positives weren't a problem, this would do:
@urls = $string =~ m!(?:\w+:/*)?(?:[\w\-]+\.)+\w+!g;
That would grab any number of words seperated by dots (without spaces), and would catch the protocol as well, if there is one.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (6)
As of 2022-10-05 07:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred way to holiday/vacation is:











    Results (21 votes). Check out past polls.

    Notices?