Skip to content

Instantly share code, notes, and snippets.

View noah35becker's full-sized avatar

Noah Becker noah35becker

View GitHub Profile
@noah35becker
noah35becker / regex-explained.md
Last active October 3, 2022 02:47
An interesting regex — Parsing template-maker strings for Mad Libs

An interesting regex — Parsing out template constructor strings for Mad Libs

/\[.*?\]|[a-z0-9']+|[^a-z0-9'\[\]\s]+|\s+/ig

In September 2022, I was part of a small team that built Mad Libs, an application that reimagines the popular word game in a browser-based forum/blog context. Among other features, the app includes:

  • A template maker, in which a user inputs a constructor string that is converted to a Mad Libs template that other users can then fill in