How to write php regular expressions to obtain the following href regular expressions
test.htmltest wawahehehahauuuu ......wawahehehahauuuu ........
You want to use a regular expression
Each href in the tag
How can I write it?
Reply to discussion (solution)
$html = <<
test wawa hehe haha uuuu ......
wawa hehe haha uuuu ........ TTT;preg_match_all('@
([^`]*?)<\/b>@i',$html,$match);preg_match_all('@href="(.+?)"@i',$match[0][0],$matches);var_dump($matches);
$html = <<
test wawa hehe haha uuuu ......
wawa hehe haha uuuu ........ TTT;preg_match_all('@
([^`]*?)<\/b>@i',$html,$match);preg_match_all('@href="(.+?)"@i',$match[0][0],$matches);var_dump($matches);
This is the firstFirst match, and then match the href
Is there a method that matches the regular expression?
I don't have this skill.
However, in addition to regular expressions, you can also use dom parsing, including simplehtmldom.
Can I match a regular expression?
~\ S * (] + href = "(.*?) "> .*?) *? \ S *~ Msi
In general, just tune it yourself