Skip to content

libs: remove redundant RegExp parts

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)

dns, repl

If I get this correctly, a RegExp part with a quantifier '0 or more' is redundant if:

  • it is used at the very beginning or the very end of the RegExp;
  • it is used in a boolean context (test());
  • or it is not captured in match()/exec() results (full or partial) or does not affect match indices.

However, these parts may improve readability and comprehensibility. If this is the case for the changed fragments, feel free to reject this PR.

Also, I can miss some other nuances, so, please, correct me.

Merge request reports

Loading