G
Guest
I cannot seem to formulate what seems should be an easy expression. I need to
find all occurances of a pattern except when it contains a specific string.
For example if the string is
Dim s As String = "xmlns:b=""base"" xmlns:h=""http://www.mydomain.com""
xmlns:t=""type"""
I need to find both xmlns:b="base" and xmlns:t="type" and replace them, but
not replace the xmlns:h="http://www.mydomain.com" occurance.
using
Dim s As String = "xmlns:b=""base"" xmlns:h=""http://www.mydomain.com""
xmlns:t=""type"""
s = Regex.Replace(s, "\s*xmlns[^=]*)=""[^=]*""", "")
I can find an replace all, but how do I keep it from replacing
xmlns:h="http://www.mydomain.com"
thx in adv for help
find all occurances of a pattern except when it contains a specific string.
For example if the string is
Dim s As String = "xmlns:b=""base"" xmlns:h=""http://www.mydomain.com""
xmlns:t=""type"""
I need to find both xmlns:b="base" and xmlns:t="type" and replace them, but
not replace the xmlns:h="http://www.mydomain.com" occurance.
using
Dim s As String = "xmlns:b=""base"" xmlns:h=""http://www.mydomain.com""
xmlns:t=""type"""
s = Regex.Replace(s, "\s*xmlns[^=]*)=""[^=]*""", "")
I can find an replace all, but how do I keep it from replacing
xmlns:h="http://www.mydomain.com"
thx in adv for help