Regex Tuesday - Challenges

Regex Tuesday is the day where everyone writes regex for a day! Every tuesday, I will push a new challenge to this website. They can be easy or tricky, and there is sure to be a variety of different challenges available.

Thanks to GitHub for the hosting, and thanks to Koen Klaren for the design!


There are currently two types of challenge; challenges where you have to do a find and replace on a given set of strings to produce a new string, and challenges where you have to match something. Every challenge will have a given set of "test cases". With the first type of challenge, the cases will be an input string and an expected output string, which will be compared with the actual output from your regular expression. The second type will be a string followed by "match" or "no match". The idea is to get your regex to pass as many test cases as possible - with some challenges, it'll be easy to get all test cases to pass, and with some, it'll be near impossible and you just have to get as many as you can to pass.

Future Challenges

I'll aim to post a challenge every tuesday, which I will post on Reddit / Twitter (@callumacrae) / webdevRefinery. Watching the repo on GitHub will also get you notifications.

If you have any ideas for challenges or would like to contribute a challenge, send me a message or a pull request. If you send a pull request, chances are I will merge it the tuesday afterwards.