3 ms·
> Pop quiz: which is the character code for a word character, \w or \W? From memory, \w. Conceptually, this is because in regular expressions, capitalization i
by imagist 10y ago
> Pop quiz: which is the character code for a word character, \w or \W?
From memory, \w. Conceptually, this is because in regular expressions, capitalization indicates negation. \w matches word characters, \W matches non-word characters, \d matches digits, \D matches non-digits, \s matches whitespace, \S matches non-whitespace.
Having a conceptual understanding helps to be able to extrapolate more information with less memorization.
I don't mean this as a refutation of your overall point; I think your point is correct, that using cheat sheets allows you to save mental bandwidth. I just think this wasn't a great example.