Hello Chris,

thanks for the examples. They show that by adding anchors, the meaning of regular expressions is no longer compositional. For example (^|a) accepts the empty word only if no characters have been read yet. So

    (^|a) =~ ""

does hold but

    a(^|a) =~ "a"

does not hold although

    a =~ "a"

does.

I deem compositionality an important property to compare the current implementation with its specification. As, currently, I don't know how to incorporate anchors without making a mess, I refrain from adding them for the moment.

A more complicated use, perhaps as part of a crazy parser:
"(a(\n)?)(^|b)(c|$)"

That's a nice example and I don't know how to express this without anchors.

Cheers,
Sebastian

--
Underestimating the novelty of the future is a time-honored tradition.
(D.G.)



_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to