in reply to Example of brainfog (Was: inconsistent regex matching)

In a Perl regex, . doesn't match the newline character by default.

- tye        

Replies are listed 'Best First'.
Re^2: Example of inconsistent regex matching (., /s)
by ww (Archbishop) on Nov 22, 2015 at 00:16 UTC

    Thank you, tye... but "brevity" and "baffled" both begin with "b" and I don't understand your observation. Have I missed such a use? I've removed all the newlines internal to each chunk (paragraph) and replaced them with a pair of \n (at Ln29-30) before applying the regex (of so I think).

      My second guess would be that you are only reporting one match per paragraph and you don't look for a match in the paragraph that contains $eot. So one of the places where you think there is a "\n\n", there might actually be a "\n \n" or even "\n\r\n", which won't count as a paragraph boundary to Perl. The missing error could be clumped together with its prior error in a single paragraph that looks like 2 paragraphs. Or it could be similarly clumped with the $eot.

      And it would be easier to you to debug the situation than for me to make guesses remotely.

      - tye