Home » Questions » Computers [ Ask a new question ]

What is the easiest way to do PCRE-style regexp search/replace for MS Word?

What is the easiest way to do PCRE-style regexp search/replace for MS Word?

You can do this by cut+paste to another RTF editor that supports them, but this does all kinds of horrid things if you want to reimport the text, like mess up tracked changes. Is there something like a plug-in that does this, or some feature that I am missing?

Asked by: Guest | Views: 119
Total answers/comments: 2
Guest [Entry]

"The wildcards in Microsoft Word are bit like Regular Expressions. This article has more detail.

Standard Regular Expressions compare to Word Regular Expressions as follows:

. becomes ?
.* becomes *
* becomes @ - e.g. lo@t matches lot and loot
[] works the same in both
() works the same in both
\ escapes wildcards in both
\b becomes < and > for matching word boundaries"
Guest [Entry]

"This website lists all the wildcards, meta-characters and caveats of Find & Replace in Word.

An important difference between Word and PCRE is that the carat ^ has a very different meaning. Carats are used to make metacharacters, like ^p for paragraph."