Skip to main content

Gist 311517677957b0128dbb7f06e746ba86

✓ Published0🌍 Public
Aamazingandyyy
Last edited Jan 7, 2020
Created on Jan 7, 2020

This visualization demonstrates a compact validation of a Rummikub tile hand using a single regular expression in JavaScript. It shows how a string of digits and letters (`1@23@@678@abc@`) can be parsed to check whether it contains exactly 13 valid tile groups, where groups consist of three or more consecutive numbers or letters with optional wildcard symbols (`@`). The code uses the `String.prototype.match()` API with the regex `/(@*(\d|[abcd]){3,}@*)/g`, then joins matched groups and compares their total length to 13. The example highlights regex-based pattern matching as a concise alternative to procedural tile-grouping logic.

AI-generated description