![]() |
#1
|
|||
|
|||
![]()
Do you guys know if this is possible? I'm using VBA, though I guess this isn't a VBA question, per se. The top three are working regular expression setups from another project. I'd like to recreate those in my Word VBA project.
With the bottom three, the first two are working setups, but the very bottom one doesn't work because "(s|z|sh|ch|x|o)" seems to match any single character in the range. I think what I'm looking for is called "alternation?" For example I'd like this "xxx(s|z|sh|ch|x|o)es" to match xxxches xxxshes but not match xxxces Is this possible? PERL regular expression. Code:
Find "s)([Tt]hey\s)(.*?)ies\b" and Replace with "$1$2y" Find "s)([Tt]hey\s)(.*?)s\b" and Replace with "$1$2" Find "s)([Tt]hey\s)(.*?)((s|z|sh|ch|x|o))es\b" and Replace with "$1$2$3" Code:
Find "([Tt]hey )([a-z]@)ies" and Replace with "\1\2y" Find "([Tt]hey )([a-z]@)s" and Replace with "\1\2" Find "([Tt]hey )([a-z]@(s|z|sh|ch|x|o))es" and Replace with "\1\2" |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
"Find and Replace" tool leaves out many of the occurrences of what I put in the "find" window | Swarup | Word | 8 | 06-24-2021 08:31 PM |
![]() |
ravl13 | Word | 4 | 12-09-2016 02:58 PM |
![]() |
slayda | Word | 3 | 09-14-2011 02:16 PM |
"Find" Wildcards | djreyrey | Word | 2 | 03-20-2011 09:36 PM |
![]() |
tollanarama | Word | 4 | 01-25-2011 02:19 AM |