nixCraft Linux Forum

nixCraft

Linux Tech Support Forum

pattern search with numbers

This is a discussion on pattern search with numbers within the Coding in General forums, part of the Development/Scripting category; This is the part which is responsible for giving me the result, but i have a small problem with this, ...


Go Back   nixCraft Linux Forum > Development/Scripting > Coding in General

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 02-14-2008, 11:16 PM
Junior Member
User
 
Join Date: Jan 2008
My distro: Debian
Posts: 2
Rep Power: 0
mercuryshipz is on a distinguished road
Default pattern search with numbers

This is the part which is responsible for giving me the result, but i have a small problem with this, this jus gives me the number which is present after the search phrase not the number before that.
The perl program actually searches for a pattern and returns a number present after the pattern in the log file.
My search phrase will be something like:
total rows rejected:
or
rows rejected

For example,

Code:
total rows rejected: 4000
it is able give the value 4000 as the result

but if my search phrase is

Code:
3000 rows rejected
its not able to give 3000

could somebody help in this?


Code:
 print qq{$1\n}
       if ($lines[ $lineNo ] =~ m{\Q$Phrase\E\s*(\d*)});
thanks.

Last edited by mercuryshipz; 02-14-2008 at 11:19 PM.
Reply With Quote
Sponsored Links
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
Search Pattern And Arrays mercuryshipz Coding in General 1 02-11-2008 02:26 PM
diff command to exclude files that match pattern piggy Getting started tutorials 1 08-13-2007 10:52 PM
Help with numbers ricc Shell scripting 3 12-16-2006 06:48 PM
script to add all numbers from 1 to 100 ricc Shell scripting 3 08-17-2005 02:27 PM
How to find different type of words (pattern matching) in vi sweta Linux software 2 06-07-2005 10:22 PM


All times are GMT +5.5. The time now is 11:01 PM.


Powered by vBulletin® Version 3.7.3 - Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36