That first one is true in js, but in most languages it's false.
Using regex to find string matches is still quite slow, but does work fairly well. In a compiled language, like rust, c, or go, it will be quite consistent, and have a constant time (unless gc interrupts it).
The short of it is: avoid regexes where possible. There are many premade solutions available.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Yea, it depends on various factors like how many time regex is being executed etc.
Eg : If your string is 'QABC' and pattern is 'ABC' then the naive algorithm will perform better.
I read somewhere about the progress being made in fast string matching with regex using pattern matching algorithms with them.
That first one is true in js, but in most languages it's false.
Using regex to find string matches is still quite slow, but does work fairly well. In a compiled language, like rust, c, or go, it will be quite consistent, and have a constant time (unless gc interrupts it).
The short of it is: avoid regexes where possible. There are many premade solutions available.