Anything (golf)
Match every non-empty string, including a lone newline. Reject only the empty string.
Preview challenge → Free account required to solveJAVASCRIPT IN PRACTICE
Shortest regex (golf) - hit every "match" and no "skip" using as few characters as possible. Trains regex and minimalism.
Solving requires a free account.
Pick a challenge and explore the rules through a concrete example.
Match every non-empty string, including a lone newline. Reject only the empty string.
Preview challenge → Free account required to solveMatch an entire non-empty string of ASCII digits 0–9. Inputs contain no newlines. Fit the pattern within the limit.
Preview challenge → Free account required to solveMatch words ending in "ing". Inputs are single lowercase ASCII words.
Preview challenge → Free account required to solveAvailable challenges: 5.
See all challenges →The full catalogue requires a free account.
Regex golf combines understanding regular expressions with a pattern-length constraint. It teaches you to spot shared data features and check the effects of generalisation. A short pattern fitted to the examples may not be suitable for validating arbitrary application data.
Build a correct regex separating the two example sets, then look for shared fragments, character classes and shorter alternatives. Each reduction can introduce unwanted matches. Check both pattern length and every string that should or should not match.
Read the description without logging in. Solving requires a free account.