PHP regular expression
- by Ferol
such text:
$text = ' href="http://yahoo.com" target="_blank"> link text </a> text... text... <br> text...';
//
$text = ' text... <a href="http://yahoo.com" target="_blank"> link text </a> text... text... <br> text...';
and such regular expression:
preg_match_all('/^(.*)(<.+>)(.*)(<\/.+>)(.*)$/',$text,$matches);
what I want, - to check if text matches the regular expression. If yes, then $matches should contain parts of string above, if not (as I guess) it should contain four zero-length arrays.
something is wrong, but I can't find, what actually is?