LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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, 09:42 AM   #1
Fonk
Member
 
Registered: May 2004
Location: Dortmund / Germany
Distribution: Debian, Fedora
Posts: 44

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, 11:32 AM   #2
aluser
Member
 
Registered: Mar 2004
Location: Massachusetts
Distribution: Debian
Posts: 557

Rep: Reputation: 43
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 11:17 AM
Perl regular expressions daYz Programming 6 08-11-2005 07:27 AM
Regular Expressions overbored Linux - Software 3 06-24-2004 02:34 PM
Perl Regular Expressions true_atlantis Programming 1 11-15-2003 05:16 PM
Regular expressions aromes Linux - General 1 10-15-2003 12:29 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:53 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
Open Source Consulting | Domain Registration