Regular expression to find href tags.
-
Hi there, I'm new to C# and .NET and just wandering if there is anything clever that I could download (library, etc.) or maybe is part of the standard C# library that could help this: In an import scenario (of tousands of articles) I have a column in the database that contains links. This is a very messy database (from a CMS) and some of the links are www.somelink.com (the good ones), etc. some are actualy with the html tag www.somelink.com I was wandering if there is a regular expression anywhere that would help me to filter out the Web link? In the worst case scenario I'll have to write it myself - not a huge worry but would prefere to resuse of course. Any help much appreciated. Kind regards, Pav
-
Hi there, I'm new to C# and .NET and just wandering if there is anything clever that I could download (library, etc.) or maybe is part of the standard C# library that could help this: In an import scenario (of tousands of articles) I have a column in the database that contains links. This is a very messy database (from a CMS) and some of the links are www.somelink.com (the good ones), etc. some are actualy with the html tag www.somelink.com I was wandering if there is a regular expression anywhere that would help me to filter out the Web link? In the worst case scenario I'll have to write it myself - not a huge worry but would prefere to resuse of course. Any help much appreciated. Kind regards, Pav
-
Hi there, I'm new to C# and .NET and just wandering if there is anything clever that I could download (library, etc.) or maybe is part of the standard C# library that could help this: In an import scenario (of tousands of articles) I have a column in the database that contains links. This is a very messy database (from a CMS) and some of the links are www.somelink.com (the good ones), etc. some are actualy with the html tag www.somelink.com I was wandering if there is a regular expression anywhere that would help me to filter out the Web link? In the worst case scenario I'll have to write it myself - not a huge worry but would prefere to resuse of course. Any help much appreciated. Kind regards, Pav
Try this :
<(a|A)[^>]*>[^<]*<\/(a|A)>
Further learning : http://www.regular-expressions.info/[^]
modified on Friday, September 12, 2008 5:10 PM
-
Hi there, I'm new to C# and .NET and just wandering if there is anything clever that I could download (library, etc.) or maybe is part of the standard C# library that could help this: In an import scenario (of tousands of articles) I have a column in the database that contains links. This is a very messy database (from a CMS) and some of the links are www.somelink.com (the good ones), etc. some are actualy with the html tag www.somelink.com I was wandering if there is a regular expression anywhere that would help me to filter out the Web link? In the worst case scenario I'll have to write it myself - not a huge worry but would prefere to resuse of course. Any help much appreciated. Kind regards, Pav
Try Expresso, its a very handy tool if your going to be doing regular expressions. It also contains a small library of reg. expressions for common problems. Here[^] Mike
Semper Fi http://www.hq4thmarinescomm.com[^] My Site