CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Regular Expressions: General Q about regex matches VI vs. Perl: Edit Log

New User

Sep 28, 2003, 4:17 PM

Views: 15724
General Q about regex matches VI vs. Perl

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)

Edit Log:
Post edited by diemaker (New User) on Sep 28, 2003, 4:18 PM

Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives