php - RegEx to find anchor element in HTML page -


i have string mixed content of plain text , html tags. example:

the state of <a href="/wiki/texas" title="texas">texas</a> cool place 

i want search specific string in html page using php file_get_contents().

eventually, want replace string string mixed content.

i tried preg_replace(), didn't work.

is going easy task regex? can give example? i'm starting out regex. if not suitable can please suggest solution.


Comments

Popular posts from this blog

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -