Skip to content

Should --crlf change dot matching behavior? #2372

Answered by BurntSushi
Simran-B asked this question in General
Discussion options

You must be logged in to vote

This is tracked by rust-lang/regex#244 --- And indeed, the last few comments talk about what . should do. The only real choice I think is to make it equivalent to [^\r\n] when CRLF mode is enabled. Other options are not really compatible with the regex engine. (And indeed, the plan for $ in CRLF mode is for it to treat \r and \n each as line endings, but \r\n as one single line ending. Ideally we wouldn't treat a lone \r as a line ending---the days of macOS using that convention are long past us---but it is too difficult to do otherwise in the regex engine.)

I would somewhat rather we wait until CRLF support lands in the regex engine for this, but it could be some time before that happens…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by Simran-B
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants