Regular Expressions 101

Community Patterns

Advent of Code Day 6

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 - 8 years ago