openresty/sregex

add multiline support

socketpair opened this issue · 6 comments

i.e. flag that remove special meaning of newlines in input data, so ^ will match first char in first chunk, and $ will match last byte in last chunk (i.e one with EOF set).

@socketpair You can use \A to match the beginning and \z to match the end of the string.

@socketpair Matching against data chunk boundaries is discouraged since usually the data stream can be splitted in an arbitrary way.

@socketpair I think it is a very bad idea to change the semantics of ^ and $ for data chunk boundaries.

No, I don't speak about chunk boundaries. Matching to chunk boundaries is wrong idea. I mean watching against begin and end of the stream. Yes, I misread about \A and \z...

Will this work for regex \A.*X\nY.*\z and input stream "test X\nY abcd" ?

@socketpair Why don't you try it out yourself with the sregex-cli command-line tool? Sorry, I don't have the time to answer questions that you can verify yourself more easily.

Consider it resolved.