• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 620
  • Last Modified:

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'
0
greg_white
Asked:
greg_white
  • 2
1 Solution
 
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

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now