I believe you are using a VBScripting object to do regular expressions. You
might find more help on that in a different forum for VBScripting. Word VBA
and Microsoft Windows don't do Regular Expression natively and most people
in this forum just use the Word VBA wildcards to search within their
documents.
See this link for initial information on RegExp
http://tinyurl.com/2yb5o7

Signature
Russ
drsmN0SPAMikleAThotmailD0Tcom.INVALID
Thanks for the suggestion, Russ. For searching, I use wildcards also but I
would like to use regular expressions since they're better for evaluating
(not searching for) text so that I don't have to do something like
If Selection=chr(13) or selection=chr(10)
if I don't know if the end-of-line character will be a soft or hard break. I
would prefer to take advantage of pattern matching rather than a specific
character. I've never been successful, for example, in writing
if selection="^p"
but I use ^p all the time for searching. If you know of a better way for
evaluating a selection, I'll readily welcome the suggestion.

Signature
Bryan
> I believe you are using a VBScripting object to do regular expressions. You
> might find more help on that in a different forum for VBScripting. Word VBA
[quoted text clipped - 25 lines]
> > mark as not being a paragraph mark). Where am I going wrong? I thought the \n
> > criteria was supposed to represent any type of line break.
Russ - 08 Jun 2007 07:24 GMT
Here is more information on trying Regular Expressions in VBA:
http://www.j.nurick.dial.pipex.com/Code/index.htm
One downside is that they rely on VBScripting or Windows Scripting which
won't work in MacWord VBA.
> Thanks for the suggestion, Russ. For searching, I use wildcards also but I
> would like to use regular expressions since they're better for evaluating
[quoted text clipped - 10 lines]
> but I use ^p all the time for searching. If you know of a better way for
> evaluating a selection, I'll readily welcome the suggestion.

Signature
Russ
drsmN0SPAMikleAThotmailD0Tcom.INVALID