Regex Named Groups: Readable Captures

Bu Endang's loan cards: a date read with (?<tahun>…), then written again through $<tahun>. m.groups and replace from the real JS engine. An interactive Regex…

Why it matters

Reading dates, logs, URLs and codes is daily work. A pattern read through m[3] is fragile: one change of order, and wrong values flow on silently. Names make a regex explain itself and survive edits.

The key idea

A name gives every group a stable key; a number follows position

Try it in this playground