From: Wes Gamble Date: 2006-05-18T01:33:54+09:00 Subject: Simple regexp: Matching CRLF in a Windows file All, I'm trying to do subs on CRLF in a Windows file, but I'm having a time of it trying to get the regexp working. I am sure that I have a text file with Windows newlines (CRLF) embedded in it This doesn't work: newline = "\C-J\C-M" puts IO.read(@document.path) =~ /#{newline}/ This doesn't work: newline = "\n\r" puts IO.read(@document.path) =~ /#{newline}/ Do I need to escape the control characters somehow so that I can match on them? I'm assuming it's possible to use control characters in a regexp. Thanks, Wes -- Posted via http://www.ruby-forum.com/.