ZTree Regex Puzzle Solution Strict - Part 1 of 2
^
(
[A-Z]
{4}
)
[-_]
(
0
[1-9]
|
[12]
\d
|
3
[01]
)
(
0
[1-9]
|
1
[012]
)
(
\d
\d
)
[-_]
(
\d
+
)
(
-
|
Of
)
(
\d
+
\.
JPG
)
$
Options: case insensitive; ^ and $ match at line breaks
Assert position at the beginning of a line (at beginning of the string or after a line break character)
Match the regular expression below and capture its match into backreference number 1
Match a single character in the range between "A" and "Z"
Exactly 4 times
Match a single character present in the list "-_"
Match the regular expression below and capture its match into backreference number 2
Match either the regular expression below (attempting the next alternative only if this one fails)
Match the character "0" literally
Match a single character in the range between "1" and "9"
Or match regular expression number 2 below (attempting the next alternative only if this one fails)
Match a single character present in the list "12"
Match a single digit 0..9
Or match regular expression number 3 below (the entire group fails if this one fails to match)
Match the character "3" literally
Match a single character present in the list "01"
Match the regular expression below and capture its match into backreference number 3
Match either the regular expression below (attempting the next alternative only if this one fails)
Match the character "0" literally
Match a single character in the range between "1" and "9"
Or match regular expression number 2 below (the entire group fails if this one fails to match)
Match the character "1" literally
Match a single character present in the list "012"
Match the regular expression below and capture its match into backreference number 4
Match a single digit 0..9
Match a single digit 0..9
Match a single character present in the list "-_"
Match the regular expression below and capture its match into backreference number 5
Match a single digit 0..9
Between one and unlimited times, as many times as possible, giving back as needed (greedy)
Match the regular expression below and capture its match into backreference number 6
Match either the regular expression below (attempting the next alternative only if this one fails)
Match the character "-" literally
Or match regular expression number 2 below (the entire group fails if this one fails to match)
Match the characters "Of" literally
Match the regular expression below and capture its match into backreference number 7
Match a single digit 0..9
Between one and unlimited times, as many times as possible, giving back as needed (greedy)
Match the character "." literally
Match the characters "JPG" literally
Assert position at the end of a line (at the end of the string or before a line break character)