Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
PCRE (PHP <7.3)

/
^((?:turn (?:on|off))|toggle) (\d+),(\d+) through (\d+),(\d+)$
/

Description

Parses the problem input for Advent of Code Day 6 into useful capture groups.

http://adventofcode.com/day/6

Submitted by Andrew Hoffmann - 9 years ago