LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 09-08-2004, 04:47 AM   #1
suchi_s
Member
 
Registered: May 2004
Posts: 133

Rep: Reputation: 15
no output generated


echo `expr match "abcABC123ABCabc" '\(.[b.c]*[A.Z]..[0.9]\)'`
after fireing this command on shell prompt it should print its output
it is givin blank line
why
 
Old 09-08-2004, 05:07 AM   #2
CroMagnon
Member
 
Registered: Sep 2004
Location: New Zealand
Distribution: Debian
Posts: 900

Rep: Reputation: 33
From the expr man page:

Pattern matches return the string matched between \( and \) or null; if \( and \) are not used, they return the number of characters matched or 0.

so it is printing a blank line because your expression is not matching anything (null). I think it is because you've made a mistake in your expression - I think you want [0-9] not [0.9]. I suspect you also mean [A-Z] instead of [A.Z].
 
Old 09-08-2004, 05:08 AM   #3
suchi_s
Member
 
Registered: May 2004
Posts: 133

Original Poster
Rep: Reputation: 15
thanks u r right
 
  


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
How do I read emails generated by the system? Akhran Linux - Newbie 2 10-22-2005 11:31 PM
Error 2 & 1 generated TuxFreak Linux - Software 1 04-23-2005 06:59 AM
hd problem generated by smartd martinius Linux - Hardware 2 04-04-2005 05:57 AM
random generated password LinuxRam Linux - Security 13 09-13-2004 05:25 AM
How are the numbers generated? pe2338 Linux - General 1 09-24-2003 10:00 AM

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

All times are GMT -5. The time now is 06:31 AM.

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