3 ms·
My main problem with the [A-Za-z0-9] notation is that it looks great at first glance. I mean, it looks really, really great. Of course [A-Z] means all capital l
by theothermkn 8y ago
My main problem with the [A-Za-z0-9] notation is that it looks great at first glance. I mean, it looks really, really great. Of course [A-Z] means all capital letters. And then you think about it, and you start to suspect something like the situation described in the article. Suddenly, you're in the familiar but dizzying position of being perched atop a shoddily-built and wobbling tower of abstractions. You feel your familiar nausea soaking in from the periphery of your editor window.
I just now, minutes ago, got some regexes to mostly sorta work in a project to convert some jai alai score data (converted from wonky pdf files). It's a one-off script. My Python is rusty, but I couldn't find how to get a posix descriptor for 'lowercase letters and uppercase letters' to work. [A-Za-z] happens to work, for now.
I love regexes. I hate regexes.
- Sharlin 8y agoEvery (Finnish) first grader knows that [A-Z] obviously doesn't mean all capital letters, because the letters Å, Ä, and Ö follow Z in the alphabet ;)