Sadly, RegEx has evolved far away from the original regular expression we learnt in school, and it is certainly less NFA like. This make it harder to execute a faster speed, e.g. backtracing makes it more context sensitive etc.
I always use https://regex101.com when I write regex. The interface is great and provides instant feedback so you can dial in your expressions quickly. But to answer your question directly, no. I don’t really know it.
Most don't, but re2 and a few others do. The ones that do use it don't have exponential runtime on malicious inputs and lack a few features (back references, mostly). https://swtch.com/~rsc/regexp/ is a great resource on this.
You can always use tools like Regex101[0] to verify if they actually work or not. I have tried a few generated by the AI, and it seems to do the job most of the time.
Note that this "regex", unlike the ones in the article, is not actually a regular expression. You could perhaps call it an irregular expression. There can be no such thing as a backreference in a regular expression.
http://swtch.com/~rsc/regexp/regexp1.html
Because the issue with the URL regex mentioned is with backtracking.
reply