Help, really simple question w/ Regular Expressions 
Author Message
 Help, really simple question w/ Regular Expressions

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!



Thu, 19 Feb 2004 04:36:22 GMT  
 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!



Thu, 19 Feb 2004 05:39:32 GMT  
 Help, really simple question w/ Regular Expressions
set re = new regexp
re.pattern = "<\?xml:namespace prefix.*?/>"

--
I would rather be able to appreciate things I can not have than to have
things I am not able to appreciate. -Elbert Hubbard

=-=-=
Steve
-=-=-


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!



Thu, 19 Feb 2004 05:32:51 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. HELP: Retrieve a TMemoField and copy lines of text to TStrings object

2. Help! 1 to N Grid displays

3. Really Simple Question on Regular Expressions

4. Rather simple regular expression and Array question....

5. Rather simple regular expression question....

6. HELP - Really, really simple printer questions

7. Help needed with a simple Regular Expression

8. Help with simple Regular Expression

9. Help with "simple" regular expression

10. C-Code in TP7.0?

11. How can read a text file?

12. simple regular expression q

 

 
Powered by phpBB® Forum Software