I'm simply testing if conditionals on a file, that is to say, only display lines beginning with "From" and lines beginning with "Subject" and the string that follows. For "Subject: " it would be anything, for "From: " I'd match the format that can be found in the lines themselves: string <email@format.com>
Indeed, testing it on the site showed me what the problem was. It didn't like the |? because I have to place a bracket before it as in (?
So the correct way seems to be:
Code:
((?<subj>Subject)|(?<from>From)): (?(subj).+|(?(from)\w+? <\w+?@\w+?\.\w{1,63})>)
So nothing to repeat meant that I was trying to associate ? with a pipe, which didn't make sense, of course.