Need one Regular Expression - Urgent

  • Thread starter Thread starter Lucky
  • Start date Start date
L

Lucky

hi guys,
i'm looking for one RegEx which can find matches from the bunch of
lines. i want to find all the matches of "<a * href=*>*</a>". if any
one can help me out here, please do come forward.


thanks,
Lucky
 
Lucky,

If you have a reply, pleas, don't than split it up between more messages.
Reply to yourself with the addition.

Cor
 
You might want to check at www.regexlib.com

hi guys,
i'm looking for one RegEx which can find matches from the bunch of
lines. i want to find all the matches of "<a * href=*>*</a>". if any
one can help me out here, please do come forward.


thanks,
Lucky
 
hi guys,
i'm looking for one RegEx which can find matches from the bunch of
lines. i want to find all the matches of "<a * href=*>*</a>". if any
one can help me out here, please do come forward.

"\<a * href=*\>*\</a\>" in MSWord

"\<a .* href=.*\>.*\</a\>" in Unix IIRC. Be aware this won't find "<a *
Href=*>*</A>"

VB Net may differ.
 
In the general case this can not be done with regular expressions,
because the <a> element can contain markup itself. You need an HTML
parser for this problem. As far as I can tell Microsoft is of no help
here. If you can consider other languages, there are well-tested
solutions for Perl, Python, and Ruby. For C# I found this link:
http://www.developer.com/net/csharp/article.php/2230091
 
(?i)<(a{1}?)[^>]*href=[^>]*[>]?(.*?)(?:</\1|/)>{1}?

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
You can lead a fish to a bicycle,
but it takes a very long time,
and the bicycle has to *want* to change.
 
Back
Top