Share via

Bug in Microsoft Word 2019, after the update of April 4, 2023. The error "The Find What text contains a Pattern Match expression which is not valid."

Anonymous
2023-04-07T18:06:23+00:00

After the last update of Microsoft Office 2019 (April 4th), it no longer works properly "Find what:" in "Find and Replace" with semicolon when I want to search or replace expressions in document.

Before the last update (April 4th) I could write to "Find what:" like this:

(["\),a-zA-Z0-9]{1;})^13(["\(a-zA-Z0-9]{1;})

(with the "Use wildcards" option enabled),

and now, after the update, the error appears "The Find What text contains a Pattern Match expression which is not valid." and I have to write, instead of a semicolon, a comma, i.e. like this:

(["\),a-zA-Z0-9]{1,})^13(["\(a-zA-Z0-9]{1,})

(with the "Use wildcards" option enabled),

specifying that my Windows 10 is set to Romanian regional options, i.e. with a semicolon (";") list separator.

And the same in VBA. Until the update, the command worked:

Selection.Find.Text = "([""\),a-zA-Z0-9]{1" & Application.International(wdListSeparator) & "})^13([""\ (a-zA-Z0-9]{1" & Application.International(wdListSeparator) & "})"

and after updating the same error appearing in VBA, "The Find What text contains a Pattern Match expression which is not valid.", and I'm forced to use the comma.

For the technical team, please fix this bug.

Microsoft 365 and Office | Word | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

17 answers

Sort by: Most helpful
  1. Anonymous
    2023-05-02T05:51:02+00:00

    After the last update of Microsoft Office 2019 (April 4th), it no longer works properly "Find what:" in "Find and Replace" with semicolon when I want to search or replace expressions in document.

    Before the last update (April 4th) I could write to "Find what:" like this:

    (["\),a-zA-Z0-9]{1;})^13(["\(a-zA-Z0-9]{1;})
    

    (with the "Use wildcards" option enabled),

    and now, after the update, the error appears "The Find What text contains a Pattern Match expression which is not valid." and I have to write, instead of a semicolon, a comma, i.e. like this:

    (["\),a-zA-Z0-9]{1,})^13(["\(a-zA-Z0-9]{1,})
    

    (with the "Use wildcards" option enabled),

    specifying that my Windows 10 is set to Romanian regional options, i.e. with a semicolon (";") list separator.

    And the same in VBA. Until the update, the command worked:

    Selection.Find.Text = "([""\),a-zA-Z0-9]{1" & Application.International(wdListSeparator) & "})^13([""\ (a-zA-Z0-9]{1" & Application.International(wdListSeparator) & "})"
    

    and after updating the same error appearing in VBA, "The Find What text contains a Pattern Match expression which is not valid.", and I'm forced to use the comma.

    For the technical team, please fix this bug.

    As far as I can see, after the last update of Microsoft Office 2019 (v. 16.0.16327.20214), the semicolon bug when searching and/or replacing expressions in the document (with "Use wildcards" option enabled) has been fixed, no longer showing the message "The Find What text contains a Pattern Match expression which is not valid". Likewise in VBA.

    From my point of view, the problem is solved.

    Was this answer helpful?

    4 people found this answer helpful.
    0 comments No comments
  2. Suzanne S Barnhill 277.8K Reputation points MVP Volunteer Moderator
    2023-04-12T00:52:42+00:00

    We've received word from the Word product team that this is an intentional change: "I was just made aware that this change is by design and is rolled out starting in the Feb Fork (version 2303, build 16227). The change is to move from locale-specific list separator character to comma for all cases (semicolon to comma in the regex). The crew is monitoring feedback on this change." If this is a significant pain point for you, be sure to submit feedback. Note that the change applies only to wildcard regex searches, not, for example, to wildcard merges or other instances where a list separator might be used.

    Was this answer helpful?

    4 people found this answer helpful.
    0 comments No comments
  3. Anonymous
    2023-04-24T09:26:31+00:00
    • Same issue here and it is a significant pain point!
      A lot of automation code created during the last decades has to be reviewed/modified.
      Having different regex syntax on different system is for sure not ideal. But changing a feature that is part of a software for many years and not providing information about the change is worse.
    • When using wildcard expressions in "Find and Replace", the "Special" command always displayed a comma "Num Occurrences { , }", but on systems with list separator set to semicolon, a semicolon was inserted. With the latest updates, a semicolon is (still) inserted, but an error message is generated when it is used.
    • (Already mentioned above) There are other functions (e.g. fields) which have a different syntax on different systems because of the dependency on the list separator.

    It would be great to have the former behavior back and get the UI fixed.

    Kind regards,
    Dieter

    Was this answer helpful?

    2 people found this answer helpful.
    0 comments No comments
  4. Anonymous
    2023-04-12T01:06:34+00:00

    Thanks Suzanne. I just heard this as well.

    I wonder what the reason might be for this change. It seems very odd and unpractical and will cause many existing templates to fail.
    Why on earth only change the separator only for wildcard searches? So in international versions we have still fields that use the international listseparator (please don't think about changing TOC fields for example) but can't use it anymore for the wildcard search/replace?
    )-:

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  5. Doug Robbins - MVP - Office Apps and Services 323K Reputation points MVP Volunteer Moderator
    2023-04-07T20:17:51+00:00

    What is the Version and Build number of your Office installation?

    Version 2303 (Build 16227.20212)

    was initially replaced by

    Version 2302 (Build 16130.20332)

    and then a day or so later, that was replaced by

    Version 2303 (Build 16227.20258)

    Try updating your Office application again and see if that overcomes the issue.

    Post back if it does not.

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments