You're talking past each other. Robert is talking about limiting the length of the regex, not the string(s) evaluated by the regex. It should be possible to compile any regex of a reasonable length in a matter of microseconds. Regardless of whether the application of the regex to a given input is near linear (as in the case of the Go RE implementation) or exponential (as in the case of PCRE). I'm pretty sure Robert is not arguing that the scaling problems of the regex implementation used by Perl, and too many others, can be mitigated simply by limiting the size of the string to be matched by the regex. If compiling a regex of reasonable length takes a non-negligible amount of time something is wrong.
On Mon, Jun 8, 2020 at 3:22 PM Wojciech S. Czarnecki <o...@fairbe.org> wrote: > Dnia 2020-06-08, o godz. 16:22:24 > Robert Engels <reng...@ix.netcom.com> napisaĆ(a): > > > it is trivial to limit the input size to something a user could input. > > With exponential complexity simple regex /(x+x+)+y/ blows up at input of > 20 to 30 x-es. > See: https://www.regular-expressions.info/catastrophic.html > > [Cut long explanations... Axel just posted most of what I was writing > regarding trade-offs). > > Hope this helps, > > -- > Wojciech S. Czarnecki > << ^oo^ >> OHIR-RIPE > > -- > You received this message because you are subscribed to the Google Groups > "golang-nuts" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to golang-nuts+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/golang-nuts/20200609002207.0a161adf%40xmint > . > -- Kurtis Rader Caretaker of the exceptional canines Junior and Hank -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CABx2%3DD9sKeHnqUAqB61y5Ts-U_f%2BctVAuS4BC0ae8phhhcp1iw%40mail.gmail.com.