Comment: IN THE BEGINNING, THERE WERE HORSES.
Comment: THEY WERE WILD HORSES
Comment: THEN THERE WAS HAY.
Comment: THEN THERE WERE STABLES.
Comment: THESE ARE THE STORIES OF THE WILD HORSES
Definition Group(?(DEFINE)
#DESCRIBE THE WILD HORSES AND SET THEM LOOSE UPON THIS EARTH
(?'wildhorses'
[[:alpha:]\ ']*(?>[[:punct:]]+(*ACCEPT)|\R(*ACCEPT))
)
) Comment: DESCRIBE THE WILD HORSES AND SET THEM LOOSE UPON THIS EARTH
Group wildhorses(?'wildhorses'
[[:alpha:]\ ']*(?>[[:punct:]]+(*ACCEPT)|\R(*ACCEPT))
) Character Class[[:alpha:]\ ']* *matches any number of characters from the set below:
[:alpha:]an alphabetic character [a-zA-Z]
\ the literal (3210 / 408 / 2016)
'the literal ' (3910 / 478 / 2716)
Atomic Group(?>[[:punct:]]+(*ACCEPT)|\R(*ACCEPT)) 1st Alternative[[:punct:]]+(*ACCEPT) Character Class[[:punct:]]+ +matches at least one character from the set below:
[:punct:]a punctuation character [!"#$%&'()*+,\-./:;<=>?@[\]^_`{|}~]
(*ACCEPT)immediately succeeds the current match or subroutine; inside an assertion, resolves it according to whether it is positive or negative
2nd Alternative\R(*ACCEPT) \Ra newline sequence
(*ACCEPT)immediately succeeds the current match or subroutine; inside an assertion, resolves it according to whether it is positive or negative
Group bronco(?<bronco>
#RELEASE THE WILD HORSES
(?P>wildhorses)(*COMMIT)
) Comment: RELEASE THE WILD HORSES
(?P>wildhorses)calls group wildhorses as a subroutine
(*COMMIT)if the rest of the pattern fails, ends the entire match operation without trying another starting position
Character Class[[:blank:]]+ +matches at least one character from the set below:
[:blank:]a whitespace character, excluding line breaks [ \t]
Group foal(?<foal>
#LET THEM ROAM ACROSS OUR LANDS
(?P>wildhorses)(*ACCEPT)
) Comment: LET THEM ROAM ACROSS OUR LANDS
(?P>wildhorses)calls group wildhorses as a subroutine
(*ACCEPT)immediately succeeds the current match or subroutine; inside an assertion, resolves it according to whether it is positive or negative
Comment: THE REST ARE STABLES AND MUST NOT NOT BE MATCHED BY OUR WILD HORSES.
Comment: IN THE END THERE WAS HAY AND STABLES, AND THE HORSES WERE NO LONGER WILD.
Comment: </fin>
g modifier: global. Finds all matches instead of stopping after the first
x modifier: extended. Ignores unescaped whitespace and comments outside character classes
m modifier: multiline. Causes ^ and $ to match the start and end of each line, not only the start and end of the string