Why not support plural form?
See original GitHub issueIn addition to
SuperExpressive().exactly(5).digit
why not support
SuperExpressive().exactly(5).digits
?
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@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 😑 ).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!