NiallWaller
Newcomer
- Joined
- Apr 11, 2003
- Messages
- 1
Need a Regular Expression to strip out the text inside a anchor tag (<a> here </a>)
Sounds simple but the simple answer wont allow for nested tags inside the <a> tag...
something like this
<a [^>]*>(.*)</a>
where the .* obviously replaces what i'm looking for.
but needs to allow for nested tags like:
<a href=blah> <b>text1</b> </a>
picking up "<b>text1</b>"
And find adjascent <a> tags separetely
<a href=blah>text1</a>text2<a href=blah>text3</a>
picking up "text1" and "text3" seperately
All being used in .net - so lookahead assertions are a possible if anyone knows a solution using them...
Any help appreciated
Thanks,
Niall
Sounds simple but the simple answer wont allow for nested tags inside the <a> tag...
something like this
<a [^>]*>(.*)</a>
where the .* obviously replaces what i'm looking for.
but needs to allow for nested tags like:
<a href=blah> <b>text1</b> </a>
picking up "<b>text1</b>"
And find adjascent <a> tags separetely
<a href=blah>text1</a>text2<a href=blah>text3</a>
picking up "text1" and "text3" seperately
All being used in .net - so lookahead assertions are a possible if anyone knows a solution using them...
Any help appreciated
Thanks,
Niall