I have a log file which have logs very similar to Apache logs
Here is a sample log line
41.13.0.155 - - [03/May/2012:00:00:08 -0700] "GET /gameState?type=udid&udid=A100001837E58D4&game=TapFish HTTP/1.1" 200 38812 - "Dalvik/1.4.0 (Linux; U; Android 2.3.5; GT-B5510 Build/GINGERBREAD)"
I am able to separate this string from log line "GET /gameState?type=udid&udid=A100001837E58D4&game=TapFish HTTP/1.1"
I want to iterate all the lines to grab all the log line which fulfil following condition
Log line should have "GET /gameState?type=[[anything]]" but [[anything]] should not be 'neighbor'
Please suggest some regular expression which can match the string on above conditions
I’m not sure I understood all of your constraints, but this should work:
You’re basically not matching if it spots
type=neighboranywhere aftergameState, and only ifneighboris at word boundary (type=neighborhoodis ok).