I get ASSERTION FAILED using VBSCRIP RegEx

Claudio Pratella 50 Reputation points
2025-09-08T15:28:56.48+00:00

I get this error using Web and app.User's image

Microsoft 365 and Office | Excel | For business | Windows
{count} votes

Answer accepted by question author
  1. Hendrix-C 8,650 Reputation points Microsoft External Staff Moderator
    2025-09-08T20:43:30.16+00:00

    Hi @Claudio Pratella

    Thank you for your prompt update. I've tried the pattern you provided and in my test device the result turns out that it still works properly in my Excel version.  

    However, according to your sharing, the issue happens after a recent update, and everything has worked normally until then. It's a right way to suspect whether it's a new issue with version updates but currently there has not been any official notifications about this issue from Microsoft. For now, we suggest you can try downgrade Excel to older version to see it still works well there and also prevent the negative effect of the issue to your workflow. You can follow these steps: 

    Step 1: Download and Extract ODT 

    Step 2: Create Your Custom Configuration File 

    • Open Notepad and paste the following XML: 

    <Configuration>  

    <Updates Enabled="TRUE" TargetVersion="16.0.xxxxx.yyyyy" />  

    </Configuration> 

    Step 3: Run the Installer 

    • Open Command prompt as administrator, navigate to the folder where setup.exe and your XML file are located, then run: 

    setup.exe /configure config.xml 

    • This will install the specified version of Office/Excel. 

    Step 4: Disable auto updates (Optional) 

    • Open Excel. 
    • Go to File > Account > Update options. 
    • Select Disable updates to prevent reverting to newer versions. 

    For more detailed guideline, you can refer to How to revert to an earlier version of Office - Microsoft Support

    Additionally, I strongly recommend submitting in-app feedback so that your experience can be formally logged with our engineering team. You can do this from Excel > Help > Feedback or go to Microsoft 365 Feedback Hub > send feedback. 
    User's image

    For now, I highly recommend accepting this answer as well. That way, other users who encounter the same question will see the clarification, and more of them may report similar problem, helping to bring attention to the request. The more reports the team receives, especially from business users, the faster issues like this can be prioritized and resolved as soon as possible. 

    I know this is not the experience you expected, and I want to thank you for your patience while the team works on improvements.  

    Thank you for your understanding and corporation. Please let me know if there's anything else I can help you with. 

    Looking forward to your response.


     If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".   

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread


6 additional answers

Sort by: Most helpful
  1. Claudio Pratella 50 Reputation points
    2025-09-08T18:03:45.3233333+00:00

    I used the pattern you used and also in my case it worked, but Regular Expressions are used for complex situations and I use, by far, more complex patterns.

    I tried a bit more complex pattern:

    "\b(the|-|an|this|that|those|these)\b(?= is)"

    and I received same error.


  2. peiye zhu 320 Reputation points
    2025-09-13T00:04:25.6466667+00:00

    Same issueDim mRegExp As Object

    1. Dim mMatches As Variant
    2. Set mRegExp = CreateObject("VBScript.RegExp")
    3. With mRegExp
    4. .Global = True
    5. .Pattern = "((?=[0-9])\b(13[0-9]|14[5|7|9]|15[0-3|5-9]|166|17[1-8]|18[0-9]|19[1|3|5|8-9])[\s]\d{4}[\s]\d{4}(?![0-9]))|((?=[0-9])\b(13[0-9]|14[5|7|9]|15[0-3|5-9]|166|17[1-8]|18[0-9]|19[1|3|5|8-9])\d{8}(?![0-9]))|(0(\d{3}-|\d{2}-))?(\d{8}|\d{7})(?!\d)"
    6. Set mMatches = .Execute(Target.Value)
    7. End With
    8. Set mRegExp = Nothing
    9. If mMatches.Count > 0 Then MsgBox mMatches(mMatches.Count - 1)Screenshot_2025-09-13-08-01-57-699_com.mmbox.xbrowser.pro

    Previous version no this problem


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.