Regular Expression to extract hyperlinks containing keyword

I need a regular expression that can be used in VB6, that extracts a hyperlink / URL from a html page or .txt document.  I need it to extraxt only links that contain a certain keyword or phrase, example: 'foo'
greg_whiteAsked:
Who is Participating?
 
solntcevCommented:
i think something like this
(http://[^ ]*foo[^ ]*)

Open in new window

0
 
greg_whiteAuthor Commented:
That's close...

It's stopping only when it finds a space:
Example it catches this whole piece instead of stopping at the second quotes.
http://www.domain.com/foo.php"/>
      <link

In place of the quote could we put \"...

Well I tried that and it works...

Thanks...
0
 
solntcevCommented:
try this
(http://[^ "]*foo[^ "]*)

Open in new window

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.