Regex: Finding wrong hyperlink in url -
was looking see if knew of way detect, through regex, mismatched hyperlinks within link
example:
www.google.com, in email, hyperlinked yahoo.com
www.google.com, pointing internetbadguys.com
you can use /<a.*?href=\"http[s]?:\/\/([\w\.]+).*?\".*?>(?!\1).*<\/a>/g
. test online
since have not provided sample code, have assumed few cases.
Comments
Post a Comment