skydiver38 on 10 Oct 2008 13:46:50 -0700


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] egrep help


off the top of my head, so take this with a grain of salt...
 
You don't have anything for your "*"s to match.  IIRC, the "*" means "0 or more", but you don't tell it zero or more of *what*.  I'm not sure if egrep recognizes "\d" as meaning "numeric chars" or if you need to qualify a range of chars like "[0-9]".
 
And does egrep recognize "{1-3}" for specific numbers of items, or are you limited to "1 or more" type of qualifiers?
 
so something like "cat Developer*.csv | egrep [0-9]?\.[0-9]?\.[0-9]?\.[0-9]?\|\| | head" might work.  You may need to quote the regex.  Replace the "?"s with "{1-3}" if egrep recognizes that (my experience with regexes is with perl).
 
Good luck - someone more knowledgable will probably speak up soon.
 
 
-------------- Original message --------------
From: "Michael Lazin" <microlaser@gmail.com>
Hi, I'm trying to grep a CSV for an IP address followed by ||

I tried grep Developer *.csv | egrep \|*\.*\.*\.*\|\||head

but this is not working, it is picking up false positives, what I am looking for specifically is an IP address followed by || in the csv.  I am working on trying to teach myself regular expressions now but I am just in the beginning stages.  Any help would be appreciated. 

--
Michael Lazin
To gar auto estin noein te kai enai
--- Begin Message ---
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug

--- End Message ---
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug