Reputation: 81
I'm writing a regular expression to parse a logfile and I'm having trouble figuring out how to establish a range(?) of sorts for a particular expression. In this case specifically, my logfile contains various severities:
(['EMERG','ALERT','CRIT','ERR','WARNING','NOTICE','INFO','DEBUG'])
I'm basically wondering how I'd write regular expression to match all of those. I understand most digit work, but characters are posing difficult issues for me.
Upvotes: 0
Views: 63
Reputation: 4159
this regex will match all these entries: [A-Za-z]{1,} basically it says match all patterns that have only chars from A to Z or a to z with the lenght of at least one char.
for more information see this: regex cheat-sheet
and try your regex here: http://gskinner.com/RegExr/
Upvotes: 1