LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices



Reply
 
Search this Thread
Old 06-27-2004, 10:42 AM   #1
Fonk
Member
 
Registered: May 2004
Location: Münster / Germany
Distribution: Debian, Fedora
Posts: 43

Rep: Reputation: 15
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
 
Old 06-27-2004, 12:32 PM   #2
aluser
Member
 
Registered: Mar 2004
Location: Massachusetts
Distribution: Debian
Posts: 557

Rep: Reputation: 42
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Perl regular expressions CyberJedi Programming 2 10-02-2005 12:17 PM
Perl regular expressions daYz Programming 6 08-11-2005 08:27 AM
Regular Expressions overbored Linux - Software 3 06-24-2004 03:34 PM
Perl Regular Expressions true_atlantis Programming 1 11-15-2003 06:16 PM
Regular expressions aromes Linux - General 1 10-15-2003 01:29 PM


All times are GMT -5. The time now is 06:40 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration