does /xyz$/ match "xyz\n" in pcre& #39;s multi-line mode? yes. Does it match also in not multi-line mode? also yes. *because there& #39;s a special case for \n at the end of the string.* https://abs.twimg.com/emoji/v2/... draggable="false" alt="😭" title="Laut schreiendes Gesicht" aria-label="Emoji: Laut schreiendes Gesicht">
if you don& #39;t understand why this is confusing... pcre goes through several layers of irony when deciding whether to match something or not
I& #39;m dealing with this by having the AST constructed with [\n]?$ for the anchored predicate, so our basic dumb NFA now looks like this. What a mess. (The unused .* at each end are attachment points for the unanchored forms - those get trimmed away during conversion to DFA, later)
I& #39;m annoyed because now I have to update all my tests for the NFA construction to expect the optional newline there.
You can follow @thingskatedid.
Tip: mention @twtextapp on a Twitter thread with the keyword “unroll” to get a link to it.

Latest Threads Unrolled: