Other implementation of regular expressions handle "newline" mechanics
related to "^" and "$" semantically instead of literally.  By that I mean
that both "\r\n" and "\n" are considered "newlines" instead of just "\n".

If changing behavior is not desirable I would be content with another flag
that would toggle such behavior.

In code - both of these subqueries should match whereas presently only the
first one does.

SELECT regexp_matches(E'123\n',   E'123$', 'w');
SELECT regexp_matches(E'123\r\n', E'123$', 'w');

I don't know if this is server O/S dependent...but I would not expect it to
be so.

Having to say something like:  , 'wr'  (r =
combine-\r-with-adjacent-newline) would be OK but not ideal.  I'm not
seeing much risk in changing this particular behavior.

Thanks!

David J.

P.S. Forgive me for re-iterating the dislike of calling and describing "w"
as "weird" and "rarely useful".  I find it to be quite useful and my source
material doesn't seem particularly unusual.

Reply via email to