in reply to Continue reading regex to next line
Its output is:use strict; use Regexp::Common qw /URI/; my $big_string; while (<DATA>) { chomp; $big_string .= $_; } my @websites = $big_string =~ m/($RE{URI}{HTTP})/g; print join "\n", @websites; __DATA__ This is a test this is a test test test http://www.website. com/getme.html this is test this is a test This is a test this is a test test test http://www.website2.com/ getme.html this is test this is a test This is a test this is a test test test http://www.website3.com/getme .html this is test this is a test This is a test this is a test test test http://www.website4.com/getme. +h tml this is test this is a test
http://www.website.com/getme.html http://www.website2.com/getme.html http://www.website3.com/getme.html http://www.website4.com/getme.html
CountZero
A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James
|
|---|