in reply to Re^2: Incorrect Pattern Matching Behavior
in thread Incorrect Pattern Matching Behavior
The problem is in the implementation of this clause:
Either INOUT or OUTPUT
Your regular expression is getting parsed as:
/ # either this ^ S \s+ [-]* \d+ [\.\d+]* \s+ [-]* \d+ [\.\d+]* \s* \( \s* IOPUT | # or this OUTPUT \s* \) /ix
To achieve your aims, you need to tell perl where your list of alternates starts and ends, with capturing (...) or non-capturing (?:...) parens:
/ # all of this ^ S \s+ [-]* \d+ [\.\d+]* \s+ [-]* \d+ [\.\d+]* \s* \( \s* # and one of these two (?: IOPUT | OUTPUT ) # and all of this \s* \) /ix
I'd also recommend using the extended layout permitted by the //x flag for long expressions like this.
Hope this helps,
Hugo
|
|---|