I\'m using preg_match_all to find a URL in a HTML file. The URL always appears at the start of the line, with no leading space, like this:
preg_match_all
^ matches start-of-string not start-of-line. Use the m ("multi-line") modifier: //m
^
m
//m