php - regular expression: Find url from anchor tag -


I have a problem I want to find the url form acnchor tag containing the "title" tag in the anchor tag.

  Example: & lt; A href = "http://www.test.com" title = "Xyz" & gt; This test is & lt; / A & gt;  

How can I match the string and get the url using regular expressions.

Thanks

& lt; A \ s + ([^ & gt;] *) href = "(https :: \ / \ / ([^" * *)) "\ s + ([^ & gt;] *) Title =" xyz " (. *?) & Gt; (. *?) & Lt; / a & gt; You can partial match $ 2 , you can try it

< / Div>

Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -