Page MenuHomeFeedback Tracker

regexMatch causes a crash in some cases
Feedback, NormalPublic


Currently the only repro I know is matching a text that has many \n characters in sequence, and matching it with (?:\t|\s|\n|\r)* (seems like the character \s is the culprit)

Edit: I realized my regex was checking duplicate items. i.e: \s already means "all whitespaces", not just "space" (what I thought it was). So using just \s* doesn't cause a crash.

But still it shouldn't crash because of a wrong regex.


Operating System
Windows 10 x64
Steps To Reproduce

Execute this code:


?" regexMatch "(?:\t|\s|\n|\r)*"

seems like it's related to the \s character. Using this regex works fine: "(?:\t| |\n|\r)*". Also works fine with \s*

Event Timeline

Leopard20 created this task.Oct 1 2021, 3:09 PM
Leopard20 updated the task description. (Show Details)Oct 1 2021, 9:58 PM
Leopard20 edited Steps To Reproduce. (Show Details)
Tenshi set Ref Ticket to Internal Ref.: AIII-54826.Dec 7 2021, 12:29 PM
Tenshi added a subscriber: Tenshi.Dec 7 2021, 12:37 PM

Thank you for reporting the issue.

dedmen changed the task status from New to Feedback.Jan 14 2022, 3:27 PM
dedmen claimed this task.
dedmen added a subscriber: dedmen.

Post-fix, next week dev or profv7

15:26:24 Error in expression <
?" regexMatch "(?:\t|\s|\n|\r)*">
15:26:24   Error position: <regexMatch "(?:\t|\s|\n|\r)*">
15:26:24   Error Foreign error: Regular Expression parsing failed with: The complexity of matching the regular expression exceeded predefined bounds.  Try refactoring the regular expression to make each choice made by the state machine unambiguous.  This exception is thrown to prevent "eternal" matches that take an indefinite period time to locate.