N
.NET Developer
Hello,
I'm trying to write a RegEx that will find all occurances of a particular
type of HTML anchor <a> element in a big block of HTML. Here are the pattern
requirements - they consist of certain attributes being present, basically:
must start with "<a" followed by 1 or more white-space characters
then, before the closing tag ">" it must contain 3 attributes:
1. class
2. href
3. id
the values for these 3 attributes must be a 1 or more character string. Both
single and double quotes have to be able to work and it should not be case
sensitive.
Also - I'm trying to figure out how, once I have the matches, to write
RegEx's to help me get the value out of each attribute. Such as getting
"MyValue" out of id="MyValue".
I've tried looking at a few different Regular Expression websites and
downloaded some utilities (like The Regulator) but I'm a RegEx n00b and I've
having a hard time figuring out this more complex RegEx.
Any help is appreciated
Thanks,
---Jason
I'm trying to write a RegEx that will find all occurances of a particular
type of HTML anchor <a> element in a big block of HTML. Here are the pattern
requirements - they consist of certain attributes being present, basically:
must start with "<a" followed by 1 or more white-space characters
then, before the closing tag ">" it must contain 3 attributes:
1. class
2. href
3. id
the values for these 3 attributes must be a 1 or more character string. Both
single and double quotes have to be able to work and it should not be case
sensitive.
Also - I'm trying to figure out how, once I have the matches, to write
RegEx's to help me get the value out of each attribute. Such as getting
"MyValue" out of id="MyValue".
I've tried looking at a few different Regular Expression websites and
downloaded some utilities (like The Regulator) but I'm a RegEx n00b and I've
having a hard time figuring out this more complex RegEx.
Any help is appreciated
Thanks,
---Jason