
Help, really simple question w/ Regular Expressions
s1 = "<?xml:namespace prefix = st1 ns =""urn:schemas-microsoft-com:office:smarttags"" />"
s2 = "<?xml:namespace prefix = o ns =""urn:schemas-microsoft-com:office:office""/>"
s3 = "<?xml:namespace prefix = st1 />"
p = "<\?xml:namespace prefix.*?/>"
set re = new regexp
re.pattern = p
re.ignorecase = true
wscript.echo re.test(s1),re.test(s2),re.test(s3)
--
Michael Harris
Microsoft.MVP.Scripting
--
Please do not email questions - post them to the newsgroup instead.
--
Quote:
> Hello Everyone,
> I'm fairly new to VBScript, and I'm just looking for a Regular Expression
> that would be generic enough to allow me to search for all three occurrences
> of the following three strings;
> <?xml:namespace prefix = st1 ns =
> "urn:schemas-microsoft-com:office:smarttags" />
> <?xml:namespace prefix = o ns =
> "urn:schemas-microsoft-com:office:office" />
> <?xml:namespace prefix = st1 />
> The pattern here is that all three strings start with " <?xml:namespace
> prefix " and end with " /> "
> I've been looking the VBScript documentation for quite some time, but I
> haven't been able to find anything or maybe I just don't see it.
> Thanks guys!