3 ms·
Ha, trying to paste "regex filter numbers divisible by 3" and the page froze to death https://stackoverflow.com/q/10992279/41948 https://stackoverflow.com/q/10
by est 3y ago
Ha, trying to paste "regex filter numbers divisible by 3" and the page froze to death https://stackoverflow.com/q/10992279/41948 https://stackoverflow.com/q/10992279/41948
^(?:[0369]+|[147](?:[0369]*[147][0369]*[258])*(?:[0369]*[258]|[0369]*[147][0369]*[147])|[258](?:[0369]*[258][0369]*[147])*(?:[0369]*[147]|[0369]*[258][0369]*[258]))+$
^([0369]|[147][0369]*[258]|(([258]|[147][0369]*[147])([0369]|[258][0369]*[147])*([147]|[258][0369]\*[258])))+$
I wonder if there's a shortest one.
- abareplace 3y agoThe web page hangs on the regular expressions that produce a DFA with a lot of states. For example, these ones: (ab+c+)+ (abc){100} a.*quick brown fox jumps over the lazy dog
- zamadatix 3y agoThe page says it doesn't support anchors anyway.