mutley1
MIS
- Jul 24, 2003
- 909
SQL 2000.....
Hi all,
Trying to help a friend out but this is way over my head. We want to extract a string between 2 specific character sets (it's an varchar field holding an XML string). the thing is, the open / close tag may appear more than once within the main string. E.g. if the open tag is <p> and the close tag is </p>, would like to retrieve the string between the tag. As mentioned, there may be more than one occurrence of open close tag within one field and would like to return both, all 3, all 4 of the strings (seperately) from the one main string.
desired outcome would be
what's the best way to start on this?
TIA peeps,
M.
Hi all,
Trying to help a friend out but this is way over my head. We want to extract a string between 2 specific character sets (it's an varchar field holding an XML string). the thing is, the open / close tag may appear more than once within the main string. E.g. if the open tag is <p> and the close tag is </p>, would like to retrieve the string between the tag. As mentioned, there may be more than one occurrence of open close tag within one field and would like to return both, all 3, all 4 of the strings (seperately) from the one main string.
Code:
abc<p>hello John</p>zxzxzxxzx<p>hello Fred</p>erererer""some other rubbish<p>happy new year</p> do be do be do<p>thank you John</p>
desired outcome would be
Code:
hello John
hello Fred
happy new year
thank you John
what's the best way to start on this?
TIA peeps,
M.