You can’t say it arbitrary regex inputted by a user then claim they can be arbitrarily long - these are incompatible. For any reasonable user input the compile time is negligible, and it is trivial to limit the input size to something a user could input.
> On Jun 8, 2020, at 2:27 PM, Axel Wagner <axel.wagner...@googlemail.com> wrote: > > > And that exact logic is what wouldn't work, if compilation or matching would > be exponential, for example. > Being able to say "as long as the inputs don't get astronomically long, the > running time of the algorithm will be reasonable" is *exactly* the conclusion > that a small complexity class gives you. > >> On Mon, Jun 8, 2020 at 7:17 PM Robert Engels <reng...@ix.netcom.com> wrote: >> If the input regex string is bounded by a typical user input box - the >> compilation time will be negligible when compared to the runtimes. >> >>>> On Jun 8, 2020, at 11:07 AM, Axel Wagner <axel.wagner...@googlemail.com> >>>> wrote: >>>> >>> >>> Oh, true, I overlooked that detail. But FTR, they clarify their question >>> subsequently and specifically ask whether compilation is linear in >>> expression size. No Must* in that clarification. >>> >>>> On Mon, Jun 8, 2020 at 6:05 PM Thomas Bushnell, BSG <tbushn...@google.com> >>>> wrote: >>>>> On Mon, Jun 8, 2020 at 12:02 PM Axel Wagner >>>>> <axel.wagner...@googlemail.com> wrote: >>>> >>>>>> On Mon, Jun 8, 2020 at 5:41 PM Thomas Bushnell, BSG >>>>>> <tbushn...@google.com> wrote: >>>>> >>>>>> The OP was about MustCompile, so I think it's clear they are not using >>>>>> patterns passed in by external requests. >>>>> >>>>> I don't think that's clear at all. How do you assume patterns from >>>>> external sources can be matched, if not by compiling them? >>>> >>>> "MustCompile is like Compile but panics if the expression cannot be >>>> parsed." >>>> >>>> Thomas -- 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/2ADCFB57-FF38-4DE1-8FC6-D660F089BB89%40ix.netcom.com.