-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Looping when we use the wildcard regex like (.*) #40
Comments
Same issue here and still not fixed. Unfortunately the script is not usable in this state, because the whole tab crashes, even if the highlight function is called within a try/catch block. @rahulnatarajan98 have you already found a solution or do you know exactly what is causing the error? Then maybe we could check if the regex fulfills this crash condition and then not call the highlight function afterwards. |
Yeah. I created a if statement stating the regex exactly matches with ".*" then ranges array should have the index starting from 0 to length of the matching string. Also, we should run the while loop whenever the regex value is not equal to .* Doing this is not a quite good idea. But this will overcome the issue. |
Okay, I see. Thank you. The problem with this approach is that there are an infinite number of regular expressions that will cause a crash. Since the tab crashes all the time and the devtools disconnect immediately, it is difficult to investigate the error. So I can only assume that this is the problem. I was hoping that you have already taken a closer look at the problem or found a general solution. |
Actually, I had validation checks before using the regex in the plugin. I used the RegExp Object in Javascript in creating a regex from a string. For example In JS, this regex wont get created as it in invalid regular expression. |
The Ranges for regular expression makes an infinite loop while trying to use wildcard regex (.*)
The text was updated successfully, but these errors were encountered: