Yup, said fun with regex. My standard line is the old favorite “I have a problem that I solved with regex and now I have two problems”…
But Josh Bush tweeted about a regular expression game that Erling Ellingsen built.
There’s 15 levels that exercise different expressions in regex.
- Plain strings
- Anchors –
- Ranges
- Backrefs
- Abba
- A man, a plan
- Prime
- Four
- Order
- Triples
- Glob
- Balance
- Powers
- Long Count
- Long Count v2
I love these types of challenges specifically because gives a fun way to learn new things and experiment without fear. I started playing it yesterday and it’s a fantastic time suck for a geek like me. Without looking up the regex cheatsheet, I got to about 1500 but then I had to dive deeper into backreferences and grouping than I had before. I wish JavaScript supported nested references but oh well.
I’m currently at 3293 but I’m positive I can break 3500 at some point in the near future as I don’t really feel like I’ve cracked Glob, Prime, or Triples.
Go play the Regular Expression game and make sure that you comment with your scores! 🙂