LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Perl and Regular Expressions (https://www.linuxquestions.org/questions/programming-9/perl-and-regular-expressions-198262/)

Fonk 06-27-2004 10:42 AM

Perl and Regular Expressions
 
Hello,

can anybody tell me, why the following Expression does not match this line:

#gptofoo pcl-900 printer/HP-Business_Inkjet_2200

Regular Expression:

if (m!^\#\s*gptofoo\s+([^\s]+)\s+([^\s]+)!) {

Greets
Frank

aluser 06-27-2004 12:32 PM

Code:

$ perl -le '$line = "#gptofoo pcl-900 printer/HP-Business_Inkjet_2200"; print "hi" if $line =~ m!^\#\s*gptofoo\s+([^\s]+)\s+([^\s]+)!'
hi

it does too match! lol


All times are GMT -5. The time now is 10:29 PM.