
diemaker
New User
Sep 28, 2003, 4:17 PM
Post #1 of 9
(15624 views)
|
General Q about regex matches VI vs. Perl
|
Can't Post
|
|
I have a simple text file with \n at the end of each line. Using VI to find \w\n, it highlights the last character and \n at the end of each line. In my Perl code, @text = <FILE> and then my $stext = "@text"; Perl can find the \n, but not \w\n. If I put \s\n, then it finds every \n, but there is no \s before the \n, only word characters. I output $stext to a file and again using VI, I can find \w\n. A here-document (text in the code itself) works as I would expect it and my code finds all \n and \w\n correctly. In this case and in general, why does Perl not find what VI clearly indicates is present?
(This post was edited by diemaker on Sep 28, 2003, 4:18 PM)
|