I was drawn by your title because, while I’ve never used regular expressions in PowerShell — I’ve barely used PowerShell — I use them in Word and Word VBA all the time. The syntax is completely different, of course. One thing that it’s important to remember about regex in Word is that they’re “easily satisfied” (the opposite of greedy). That means that there are some things you just can’t do but other things become safer and easier.

Combine regex with Words ability to search for formatting (only bold text, only a particular paragraph style etc.) and VBA’s ability to loop through all the files in a folder and you have a very useful tool.

I’ll certainly be checking out PowerShell a bit more than I have already. And now I have three problems! Thanks.

I’ll delete Medium profile end June 2021, then these posts will move to my own site: https://www.artkavanagh.ie |Newsletter: https://talkaboutbooks.substack.com

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store