
Signature
Russ
drsmN0SPAMikleAThotmailD0Tcom.INVALID
Russ,
Because of other issues with formatting being lost or changed (we're trying
to apply a new paragraph level style template to pre-existing documents--Yes,
I know that is rife with problems, but we don't create the documents here),
the formatting is converted to tagging (text) near the beginning of the
processing process and removed. This pretty much gives us a flat document to
work with. So, since the formatting is present in the document only as tags,
Word's wildcard search falls short because of the necessary tag capturing
possibilies and the need to use those tags as decision points. The macro with
performs the particular RegEx search in question is just one in a suite of
over seventy macros that get run as a part of this process.
Here's an example of the kind of RegEx I'm talking about:
re.Pattern = "^([<][-italcbodsunerp/<>3]+[>])
?([^.<]+)([.])([^.<]+)([.]?[<][-italcbodsunerp/<>]+[>][\u2013\u2014\u2015]+|[.]?[\u2013\u2014\u2015]+[<][-italcbodsunerp/<>]+[>]|[<][-italcbodsunerp/<>]+[>][.]?[\u2013\u2014\u2015]+|[.]?[<][-italcbodsunerp/<>]+[>]—|[.]?—[<][-italcbodsunerp/<>]+[>]|[<][-italcbodsunerp/<>]+[>][.]?—|[.]?[<][-italcbodsunerp/<>]+[>]
[-] |[.]? [<][-italcbodsunerp/<>]+[>][-] |[.]? [-][<][-italcbodsunerp/<>]+[>]
)([<a-zA-Z0-9])"
Actually, this is a fairly simple one as it is not using nested,
non-capturing groups, look ahead or look back (none of which are possible
using Word's Wildcard S/R). This is only one of several RegEx that are run to
do the same thing. So, I'm not really trying to cram everything into one
expression ;), just into 5 to 10 :)
Converting the above to multilple wild card Word searchs (which I use
whenever possible--I guess "possible" is what is in question here ;) ) just
doesn't seem feasible to me. While, in this case, it could probably be done;
it seems to me that it would be faster to write macros which convert the
footnotes to flat text and then re-embed them after the RegEx has run. (I've
already solved the symbol conversion problem.)
Thanks,
Jeff
> Jeff,
> Could you give an example of your too complex Word find and replace
[quoted text clipped - 30 lines]
> >
> > Jeff
jalanford - 10 Aug 2006 13:28 GMT
Nevermind. Got the Footnote Macros up and running. Extracting the footnotes
with markup is tricky. :)
Jeff
> Russ,
>
[quoted text clipped - 67 lines]
> > >
> > > Jeff
Russ - 11 Aug 2006 16:30 GMT
Jeff,
A better specialty filtering tool for pre-existing markup-language files
might be http://www.powergrep.com/ which puts a Windows interface on the
unix grep command and uses the power of regular expressions.
> Nevermind. Got the Footnote Macros up and running. Extracting the footnotes
> with markup is tricky. :)
[quoted text clipped - 82 lines]
>>>>
>>>> Jeff

Signature
Russ
drsmN0SPAMikleAThotmailD0Tcom.INVALID