in reply to Re^3: Extracting useful information from Windows Event Logs
in thread Extracting useful information from Windows Event Logs

Ok I have added this to search through my text..... but the second regex is doing a backward search and not a forward search.
if (($mday1 eq $mday)&($mon eq $mon1)&($year eq $year1)) { Win32::EventLog::GetMessageText($hashRef); print "Entry $x: $mday $mon $year $hashRef->{Message}\ +n"; $Message = $hashRef->{Message}; $Message1 = $Message; if ($Message1 =~ /owned by /g) { print "xx", pos $Message1, " \n"; } if ($Message =~ / (?=owned by )/g) { print "xy", pos $Message, " \n"; } }

Replies are listed 'Best First'.
Re^5: Extracting useful information from Windows Event Logs
by blazar (Canon) on May 24, 2007 at 15:56 UTC

    I don't understand what you mean. But (?=owned by ) does not capture, and why are you interested in pos anyway? Wild guess: don't you want (?<=owned by ) maybe?