Jump to content

simple regular expression for links


burhankhan

Recommended Posts

Hi:

I have this regular expression to find links in a page.

[code]$urlpattern = "/<a[^>]+href=\"([^\"]+)/i";[/code]

This will find links like that: href="www.domain.com"

What will be regular expression to find link of href='www.domain.com' also???

see difference of single quote (') and double quote (")

I need regular express that can find both kind of links (single quote, double quote)

Any help will be highly appreciate.

Thanks
Burhan Khan
Link to comment
https://forums.phpfreaks.com/topic/36165-simple-regular-expression-for-links/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.