Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^5: REGEX for url

by NetWallah (Canon)
on Apr 25, 2016 at 21:19 UTC ( [id://1161482]=note: print w/replies, xml ) Need Help??


in reply to Re^4: REGEX for url
in thread REGEX for url

This version is a little more robust - it works in both cases - with or without setting "$/".

It can also handle multiple URL's.

use strict; use warnings; $/="</html>"; for(<DATA>){ print"$1\n" while /a href="(.*)"/g; } __DATA__ <td scope="row">9</td> <td scope="row">SUBSIDIARIES OF THE REGISTRANT</td> <td scope="row"><a href="/Archives/edgar/data/1050122/0000 +92735601000365/0000927356-01-00­0365- 0009.txt">0009.txt</a></­td> <td scope="row">EX-21.1</td> <td scope="row"><a href="/Another/URL/here.html">0009.txt</a></­td>

        This is not an optical illusion, it just looks like one.

Log In?
Username:
Password:

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

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

    No recent polls found