You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a long string and need to check if a regex matches at the beginning of it (I am writing a lexer). Unfortunately, regex-tdfa does not appear to stop searching once it is clear that there is no match. For example, the following code snippet takes several seconds to evaluate on my machine:
However, the code snippet should evaluate instantly, because as soon as the first character is inspected it is clear that the regex does not match at the beginning of the string. Given this behavior, it seems impossible to use regex-tdfa to performantly match a regex at the beginning of a string. Is there a special-purpose function for this that I have missed?
The text was updated successfully, but these errors were encountered:
I have a long string and need to check if a regex matches at the beginning of it (I am writing a lexer). Unfortunately, regex-tdfa does not appear to stop searching once it is clear that there is no match. For example, the following code snippet takes several seconds to evaluate on my machine:
However, the code snippet should evaluate instantly, because as soon as the first character is inspected it is clear that the regex does not match at the beginning of the string. Given this behavior, it seems impossible to use regex-tdfa to performantly match a regex at the beginning of a string. Is there a special-purpose function for this that I have missed?
The text was updated successfully, but these errors were encountered: