shreyasminocha / regex-for-regular-folk

🔍💪 Regular Expressions for Regular Folk — A visual, example-based introduction to RegEx [BETA]
https://refrf.dev
286 stars 23 forks source link

Example does not really make sense #41

Open renaud opened 9 months ago

renaud commented 9 months ago

Thanks for this great tutorial!!

https://github.com/shreyasminocha/regex-for-regular-folk/blob/974120e99e36a7bae14be913941e45b90bedc309/chapters/en/repetition.mdx#L146

A student of mine remarked that this example does not really make sense:

{2,4}? will always fall back to only matching 2 characters, so it would make more sense to write {2}?

but then again, {2}? does not make sense either, because it will always be {2}

What do you think?