Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
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?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (8)
As of 2023-12-02 17:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?











    Results (18 votes). Check out past polls.

    Notices?