/* 2009-10-10 07:40:32 [Local] Mary Mary Jane found a deposit (Narcanisum Stone) with a value of 99 PED! */ ometa Log <: Parser { digit = ^digit:d -> d.digitValue(), number = number:n digit:d -> (n * 10 + d) | digit, Time = [number:h ':' number:m ':' number:s] -> [h,m,s], Date = [number:year '-' number:month '-' number:day] -> [year, month, day], Chan = '[Local]', CName = [ letterOrDigit+:f spaces letterOrDigit+:m spaces letterOrDigit+:l ] -> [f,m,l], MName = letter+, Mone = 'found a deposit', GMining = [ CName:n spaces "found" ] -> n, //:mat ') with' 'a' 'value' 'of' number:val 'PED!' ] -> [n, mat, val], Global = [Date:d Time:t Chan:c :msg] -> [d, t, c, msg] } Log.matchAll('123', 'number') Log.match('11:22:33', 'Time') Log.match('2009-10-10', 'Date') Log.match('07:40:32', 'Time') Log.match('[Local]', 'Chan') Log.match('Mary Mary Jane', 'CName') Log.match('Mary Mary Jane found', 'GMining') //stone) with a value of 123 PED!', 'GMining') Log.match('Mary Mary Jane found a deposit (stone) with a value of 123 PED!', 'GMining') Log.matchAll('Mary Mary Jane found a deposit (stone) with a value of 123 PED!', 'GMining') Log.match('found a deposit', 'Mone') Log.matchAll('2009-10-10 07:40:32 [Local] Mary Mary Jane found a deposit (Narcanisum Stone) with a value of 99 PED!', 'Global')