
diemaker
New User
Sep 28, 2003, 9:00 PM
Views: 2256
|
|
Re: [KevinR] General Q about regex matches VI vs. Perl
|
|
|
Thanks for the reply KevinR. Let me clarify a little. Take this sample file for example: abc def ghi A search in VI for :/\w\n will find the last letter (c, f, and i) in each line and the \n at the end of each line. But in Perl, a match for \n works, but I get no matches with a search for \w\n only a match when using \s\n. sample code to count matches: my $count=0; while ($stext =~ /\w\n/g) { $count++; } So why does VI match \w\n with no problem but Perl does not in the same file? The \w\n pattern is not hard to identify. What do people use to clearly see all visible and special characters in a file?
(This post was edited by diemaker on Sep 28, 2003, 9:06 PM)
|