Challenges
68 challenges across eight tiers. Tier 8 is a warm-up; tier 1 will take an evening. Nothing is locked — play them in any order.
Tier 1 · Sorcerer55 points each
- Four Octetspar 75
Match a valid IPv4 address — four numbers 0 to 255, separated by dots, and nothing else.
match - Is The King In Check?par 265
The boss. Is the black king attacked by anything at all — pawn, knight, bishop, rook, queen or the white king?
match - Quoted, With Escapespar 18
Extract every double-quoted string, including its quotes, where a backslash escapes the next character.
extract - The Last Match Losespar 20
Two piles of matchsticks. Each turn you take as many as you like from one pile, and whoever takes the last match loses. Match the positions that are already lost for the player about to move.
match - The Next Generationpar 47
A 3×3 patch of Conway's Game of Life. Match it when the centre cell is alive in the next generation.
match - The Prime Detectorpar 11
You are given a string of 1s. Match it only when its length is a composite number — that is, not prime and not 1.
match - The Whole Gridpar 215
Eighty-one cells. Match the grid only when no digit repeats in any row, any column, or any 3×3 box.
match
Tier 2 · Archmage34 points each
- Bishop Checkpar 87
Extract every white bishop that is giving check along a diagonal, in board order.
extract - Clashes In The Boxpar 13
A Sudoku box, flattened. Extract every digit that appears again later in the box.
extract - Connect Fourpar 60
The same 7x6 Connect Four board, but now a win counts in any direction — across, down, or either diagonal. Capture the winning colour, or nothing.
capture - Everything But Pixelspar 13
Extract every number that is not immediately followed by "px".
extract - Not A Pricepar 17
Extract every number that is not a dollar amount — that is, not preceded by a $.
extract - Redact The Keypar 20
Star out everything after the sk_live_ prefix, however long the key is, leaving other text untouched.
replace - Rook Checkpar 51
Does a white rook attack the black king along a rank or a file? Any piece standing between them blocks it.
match - Run Of Fivepar 74
A hand is five cards as "2H 3S 4D 5C 6H" — rank then suit, space separated, and always sorted by rank, ascending. The rank ladder is A 2 3 4 5 6 7 8 9 T J Q K: the ace is low, so A-2-3-4-5 is a run and A-T-J-Q-K is not. Match a hand whose five ranks are consecutive on that ladder.
match - Sterling Onlypar 22
Extract the amounts that are prefixed with £ — and not the £ itself.
extract - Strong Enoughpar 26
Match passwords of at least 8 characters that contain at least one digit and at least one capital letter.
match - The Line Without Itpar 17
Match a line that does not contain the word "ERROR" anywhere in it.
match - Thousandspar 27
Insert commas as thousands separators: 1234567 becomes 1,234,567.
replace
Tier 3 · Warlock21 points each
- Collapse The Runspar 9
Squash every run of the same repeated character down to one of it.
replace - Double Letterpar 6
Match any string containing the same word character twice in a row.
match - Four Digits, No Morepar 21
Extract every run of 1 to 4 digits — but never a fragment of a longer number.
extract - Knight Checkpar 57
Does a white knight attack the black king? Eight fixed jumps, and nothing can block a knight.
match - Legal Handpar 69
Match a well-formed hand: exactly five cards, single space separated, each a rank from A23456789TJQK followed by a suit from SHDC — and no card appearing twice. Hands are always sorted by rank, ascending.
match - Matching Quotespar 11
Match text containing a quoted section — opened and closed by the same quote character, single or double.
match - Name The Pairpar 14
A hand is five cards as "AS 7H 7D 9C KS" — rank then suit, space separated, and always sorted by rank, ascending. Capture the rank that appears more than once, or match nothing if every rank is different.
capture - Nobody Winspar 67
Match a noughts and crosses board that is a draw: every square filled, and neither player with three in a row.
match - Said It Twicepar 14
Match text where the same word appears twice in a row.
match - Semver, Prerelease And Allpar 34
Capture the major, minor and patch numbers of a version, plus its prerelease tag — or nothing in group 4 when there is no prerelease.
capture - The Clashing Digitpar 8
A Sudoku row is nine characters. Capture the digit that appears twice — and match nothing at all when the row is legal.
capture - Touching A Minepar 31
A 5x5 Minesweeper grid with one square marked ?. Match it only when that square has a mine in one of its eight neighbours.
match
Tier 4 · Enchanter13 points each
- Cat Or Dogpar 15
Match strings containing "cat" or "dog" as a whole word.
match - FEN Shapepar 51
Validate the short two-field FEN: eight ranks separated by slashes, then a space and the active colour.
match - Four In A Rowpar 11
A Connect Four board, 7 wide and 6 tall, arrives as one flat string. Capture the colour — R or Y — that has four in a row horizontally. Capture nothing if neither has.
capture - Has X Won?par 40
A noughts and crosses board arrives as one flat string. Match it only when X has three in a row — across, down, or diagonally.
match - Hex Colourspar 24
Match a valid CSS hex colour — a # followed by exactly three or six hex digits, and nothing else.
match - Name The Flushpar 16
A hand is five cards as "AS 2H 5D 9C KS" — rank then suit, space separated. Ranks are A23456789TJQK (T is ten), suits are SHDC. Capture the suit if all five cards share one; no match if they do not.
capture - Name Your Groupspar 88
Rewrite a log line "DATE TIME LEVEL MESSAGE" as "[LEVEL] MESSAGE (TIME on DATE)".
replace - Pawn Check Squarespar 13
A white pawn checks the black king from the square down-left or down-right of it. Capture both squares.
capture - Pull The Date Apartpar 23
Capture the year, month and day of an ISO date as three separate groups.
capture - Read The Configpar 16
Capture the key and the value from a "key = value" line, whatever the spacing.
capture - Read The Logpar 23
Pull the timestamp, the level and the message out of a bracketed log line.
capture - Split The CSV Rowpar 14
Extract the fields of a CSV row, where a quoted field may contain commas. Quoted fields keep their quotes.
extract - Surname Firstpar 17
Turn "Ada Lovelace" into "Lovelace, Ada".
replace - The First Tag Onlypar 12
Capture the text inside the FIRST <b>...</b> tag on the line — just the text, not the tags.
capture - The Wrong Way Roundpar 45
Rewrite every DD/MM/YYYY date as YYYY-MM-DD, leaving the rest of the text alone.
replace
Tier 5 · Conjurer8 points each
- Commented Outpar 6
From a config file, extract every whole line that is commented out — every line beginning with a #. Inline comments on the end of a real setting do not count.
extract - Digits And Nothing Elsepar 5
Match strings made up entirely of digits, with at least one digit.
match - Starts With HTTPpar 5
Match strings that begin with "http".
match - Stop At The First Onepar 8
Capture everything before the FIRST equals sign: key=value=other gives key.
capture - The Front Matterpar 13
Capture everything between the opening and closing --- markers of a Markdown front-matter block.
capture - The Word Catpar 8
Extract "cat" only where it stands as a whole word.
extract - Trailing Whitespacepar 3
Match strings that end with whitespace — the ones your linter shouts about.
match
Tier 6 · Adept5 points each
- Colour Or Colorpar 7
Match both the British and American spellings of "colour".
match - Every Link In The Blobpar 13
Extract every http and https URL from a block of text, and nothing else that looks like a scheme.
extract - Long Words Onlypar 10
Extract every run of five or more lower-case letters.
extract - Squash The Gapspar 5
Collapse every run of whitespace down to a single space.
replace - Strip The Commaspar 2
Remove the thousands separators from a number: 1,234,567.89 becomes 1234567.89.
replace - Three In A Rowpar 5
Match strings containing three consecutive digits.
match
Tier 7 · Apprentice3 points each
- Contains A Digitpar 2
Match any string containing at least one digit.
match - Just The Extensionpar 8
Capture the file extension of a filename: report.q3.pdf gives pdf, not q3.pdf.
capture - Mind The Gappar 2
Match any string containing whitespace — a space, a tab or a newline.
match - Not A Letterpar 9
Match any string that contains a character which is not an A–Z letter.
match - Snake To Kebabpar 3
Turn snake_case into kebab-case: user_first_name becomes user-first-name.
replace - Vowel Huntpar 8
Pull out every lower-case vowel, in order.
extract