question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Why not support plural form?

See original GitHub issue

In addition to

SuperExpressive().exactly(5).digit

why not support

SuperExpressive().exactly(5).digits

?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

6reactions
kalmanhcommented, Jul 19, 2020

@francisrstokes - you have a point there, but if one of the main goals of the project is to be as expressive as possible SuperExpressive().exactly(5).digit is pretty lame (and not very natural 😑 ).

5reactions
francisrstokescommented, Jul 18, 2020

Hey @kalmanh,

I have thought about this, and it basically comes down to predictability. Let’s imagine you use the .digits property without .exactly(x). what would you expect the regex to look like?

  • /\d+/?
  • /\d+?/?
  • /\d*/?
  • /\d*?/?
  • /\d{1,}/?
  • /\d{2,}/?
  • /\d{2,}?/?

Even if you’re able to make a decision about how to handle that ambiguity, you then have to deal with the fact that it needs to generate differently depending on what quantifier is specified. That would complicate the mechanism that deals with quantification, increasing the code size and potential for bugs.

I actually don’t think it’s insurmountable - all of these concerns could be reasonably addressed - but at the moment I personally don’t see the benefits outweighing the costs. I’ll leave the issue open for other people to provide input.

Thanks for the feedback!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pluralizing the noun support
The word support can be a noun, verb or adjective. The adjective usage is never pluralized: This support system is weak.
Read more >
What is the plural of support?
The noun support can be countable or uncountable. In more general, commonly used, contexts, the plural form will also be support.
Read more >
supports - Simple English Wiktionary
The plural form of support; more than one (kind of) support.
Read more >
"Support" In Pluralized Form?
Support, meaning phone calls to a help desk, is a non-count noun. Do not use the plural. Support can be used as a...
Read more >
Did You Know That These Words Have No Plural?
These words are called “mass nouns,” that is, nouns that don't have a plural form in English and can't be used in plural...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found