So you wanna practice your regex (regular expression) skills?

A friend just linked me to this

It’s a good challenge if you like crosswords or regexes.

This site may also be helpful, if you need to play around with regex examples:

@Leo, does it exercise your crossword brain and tickle your coding module?

It dawned on me you could do the same sort of “challenge” with math too, something like:

 [123][.]?[456][789] [*+] [01][.]?[10] [=] [1269]+[.][390]*

and you need to find a workable solution to the underlying math, which in this case would be:

269 * 0.1 = 26.9 (intended solution, there are others)

Which then drove me to think about how you would code a program to solve these… which is a pretty good challenge in and of itself…

One example which is not the intended solution, but works, is

169 + 0.0 = 169.0

Oh how cool! I often use regex101 to build regexes. It’s the kind of thing that gets rusty very fast if you don’t do it… regularly.

Working my way slowly through AoC 2015 to warm up for December 1.

I often think I should be using match instead of regexes but they’re just so handy and quick and I don’t fully grok match, so I keep falling back on them. I think it’s considered bad form to use too much regex because they’re pretty opaque.

1 Like