Jul-11-2018, 07:57 PM
{1}
is an absolutely redundant modifier - \d
and \d{1}
are equivalent, so why would you want to add extra symbols? It is just wasteful. {,1}
is another issue - but again, ?
does the same, only in one symbol instead of 4.For 2 digits, e.g.
\d\d
is shorter than \d{2}
, so I will still go for the former (but that is a matter of taste).RE is complex enough without adding redundancies
Test everything in a Python shell (iPython, Azure Notebook, etc.)
- Someone gave you an advice you liked? Test it - maybe the advice was actually bad.
- Someone gave you an advice you think is bad? Test it before arguing - maybe it was good.
- You posted a claim that something you did not test works? Be prepared to eat your hat.