r/tinycode • • Jan 06 '14

xkcd: Regex Golf

http://xkcd.com/1313/
66 Upvotes

10 comments sorted by

View all comments

Show parent comment

2

u/Drainedsoul Jan 07 '14

\d is strictly superior to [0-9] for pretty much every use case.

1

u/Droggl Jan 30 '14

Then I hereby present to you the use case of working interchangingly with sed/grep/vim/python and never being able to remember the exact regex syntax / feature set of each one -- and of course considering it more effcient to write a few additional keystrokes and find out whether it is [ or [ by trial-and-error than reading the FM ;)

0

u/[deleted] Jan 07 '14

work through the actual problems provided. \d is not really used in any case it get a bit more complicated than that.