javallone/regexper-static

Pattern repeat count off by one error

nikcorg opened this issue · 3 comments

Hello,

Whilst using your excellent tool, I noticed repetition count has an off by one error. See attached screen shot or visit the demo.

regexper

At the same time, I tested other variants of repetition for completeness.

  • {,8} is treated as a literal value instead of at most 8 times, i.e. seemingly doesn't parse
  • {8,} correctly (save for the off-by-one) becomes 7+
  • {0,8} correctly (save for the off-by-one) becomes at most 7 times
  • {1,8} incorrectly becomes at most 7 times, instead of 1...8 times
  • {2,8} correctly (save for the off-by-one) becomes 1...7 times

Not an error, I think. It means the pattern appears once and then repeat x-1 times, that's {x}. A bit confusing though...

@CubicPill oh, I can see that now, I think you're right. Quite confusing indeed.

Closing as is ostensibly not a bug, but merely a misunderstanding of the UI.