How to use regex match end of line in Windows?
If your grep supports -P
(perl-regexp), then to match a CRLF:
grep -P '\r$' file
or:
grep Ctrl+VCtrl+M file
(Ctrl+VCtrl+M will produce ^M
)
Use a pattern which matches both line ends: \r?\n
If your grep supports -P
(perl-regexp), then to match a CRLF:
grep -P '\r$' file
or:
grep Ctrl+VCtrl+M file
(Ctrl+VCtrl+M will produce ^M
)
Use a pattern which matches both line ends: \r?\n