Originally Posted by narelle
Now I just need to consult the regex reference and work backwards to see what you've done
A quick explanation:
The delimiters are "Incident Title: " and a new line character sequence. That sequence of characters is carriage return and line feed (CRLF) in Windows and line feed (LF) in Linux and OS X. The new line sequence used depends on the operating system being used to write the code.
matches one or more characters that are not CR or LF characters. If a carriage return (
) is encountered, the regular expression engine stops. Ditto for a line feed (new line or
Parentheses are used to create backreferences. In this case, they tell the engine to save all of those characters matched by
method, which returns an array of results. The first item in the array (
) is the full match (including "Incident Title: "; this result isn't needed), and other items are added for each backreference. There's only one backreference, so the second item in the array (
) is the information you need.