parsing record record unchanging expressions


i'm now operative parser the middle record files (generated log4php, log4net log4j). distant i have good unchanging countenance parse logs, solely irritating bit: record messages camber churned lines, i can't review properly. regex i have this:



(?<date>\d{2}/\d{2}/\d{2})\s(?<time>\d{2}):\d{2}:\d{2}),\d{3})\s(?<message>.+)


the record format (which i contrast parser) this:



07/23/08 14:17:31,321 record 
message
spanning
multiple
lines
07/23/08 14:17:31,321 record summary line


when i run parser right now, i wholly line record starts on. i change camber churned lines, i wholly outcome (the whole record file).






@samjudson:



you need pass regexoptions.singleline fall unchanging expression, "." matches characters, only characters solely new lines (which default).



i attempted that, nonetheless following matches whole file. i also attempted set message-group .+? (non-greedy), nonetheless following matches unparalleled impression (which isn't i'm looking either).



the problem settlement summary matches date-group well, doesn't smack new-line only goes on on.






i regex summary organisation now. works, unless there's settlement record summary same start record message.



(?<message>(.(?!\d{2}/\d{2}/\d{2}\s\d{2}:\d{2}:\d{2},\d{3}\s\[\d{4}\]))+)


Comments

Popular posts from this blog

list macos calm editors formula editors

how hibernate @any-related annotations?

why does floated <input> control floated component slip over too distant right ie7, nonetheless firefox?