in reply to Re: Tidying and simplifying a regular expression
in thread Tidying and simplifying a regular expression

This node notwithstanding, what would one gain in the long run from a "simplified" form for the example given? How often does one build a regex in this way and then try to read it?

Not exactly a common use case, or that should've been built in... I can come up with two examples:

In both cases trying to print the resulting expression for debugging leads to something incomprehensible that itself needs to be debugged.

  • Comment on Re^2: Tidying and simplifying a regular expression

Replies are listed 'Best First'.
Re^3: Tidying and simplifying a regular expression (debugging)
by LanX (Saint) on Dec 09, 2017 at 14:41 UTC
    > In both cases trying to print the resulting expression for debugging leads to something incomprehensible that itself needs to be debugged.

    It's the other way round, you can trace the past qr compilation steps, which actually helps debugging.

    You are complaining about the verbosity of debugging informations, but you have to admit that your example is a very constructed edge case.

    AnomalousMonk is right to ask for common cases where this becomes a problem.

    I can see the point for a regex::tidy but this alone is not a very convincing incentive.

    Cheers Rolf
    (addicted to the Perl Programming Language and ☆☆☆☆ :)
    Wikisyntax for the Monastery