Re: regex headache

2014-02-04 Thread Dr.Ruud
On 2014-02-03 21:30, Paul Fontenot wrote: Hi, I am attempting to write a regex but it is giving me a headache. I have two log entries 1. Feb 3 12:54:28 cdrtva01a1005 [12: 54:27,532] ERROR [org.apache.commons.logging.impl.Log4JLogger] 2. Feb 3 12:54:28 cdrtva01a1005 [12: 54:27,532] ERROR [STDE

Re: regex headache

2014-02-03 Thread Jim Gibson
On Feb 3, 2014, at 12:30 PM, Paul Fontenot wrote: > Hi, I am attempting to write a regex but it is giving me a headache. > > I have two log entries > > 1. Feb 3 12:54:28 cdrtva01a1005 [12: 54:27,532] ERROR > [org.apache.commons.logging.impl.Log4JLogger] > 2. Feb 3 12:54:28 cdrtva01a1005 [12:

regex headache

2014-02-03 Thread Paul Fontenot
Hi, I am attempting to write a regex but it is giving me a headache. I have two log entries 1. Feb 3 12:54:28 cdrtva01a1005 [12: 54:27,532] ERROR [org.apache.commons.logging.impl.Log4JLogger] 2. Feb 3 12:54:28 cdrtva01a1005 [12: 54:27,532] ERROR [STDERR] I am using the following "^\w+\s+\d{1,2

RE: regex headache

2001-06-21 Thread Yacketta, Ronald
> Could you please explain what you're trying to accomplish in > a little more detail? Are you trying to check whether either > string is found or only if both are found in the same line? > both in the same line

Re: regex headache

2001-06-21 Thread Bradford Ritchie
Could you please explain what you're trying to accomplish in a little more detail? Are you trying to check whether either string is found or only if both are found in the same line? > Folks, > > I have been looking for a way to search for two strings in a line > at the command line I would >

RE: regex headache

2001-06-21 Thread Yacketta, Ronald
etta, Ronald > Cc: Beginners (E-mail) > Subject: Re: regex headache > > > On Thu, Jun 21, 2001 at 02:58:02PM -0400, Yacketta, Ronald wrote: > > foreach (@output) { > > foreach my $test(@lookFor) { > > $results{$test}++ if /$test/igo; > > } &g

Re: regex headache

2001-06-21 Thread Michael Fowler
On Thu, Jun 21, 2001 at 02:58:02PM -0400, Yacketta, Ronald wrote: > foreach (@output) { > foreach my $test(@lookFor) { > $results{$test}++ if /$test/igo; > } > > this should create a hash etc.. etc.. > to search for multiple words above (as you suggested?) I would > > $result

RE: regex headache

2001-06-21 Thread Yacketta, Ronald
Doh! ack! who chopped my line ;) this Communication $grepTMPFILE | grep failure | wc -l should have been grep Communication $grepTMPFILE | grep failure | wc -l the actualy sub of the code I am using is foreach (@output) { foreach my $test(@lookFor) { $results{$test}++ i

Re: regex headache

2001-06-21 Thread Michael Fowler
On Thu, Jun 21, 2001 at 01:43:44PM -0400, Yacketta, Ronald wrote: > I have been looking for a way to search for two strings in a line > at the command line I would Well, for this you'd use something like: open(FILE, $file) || die("Unable to open file \"$file\": \l$!.\n"); while () {

regex headache

2001-06-21 Thread Yacketta, Ronald
Folks, I have been looking for a way to search for two strings in a line at the command line I would Communication $grepTMPFILE | grep failure | wc -l how would this be converted into perl/regex? I have part of it right now (Thanxs to others on the list) foreach (@output) { foreach my