Мы можем просто использовать выражение с несколькими группами захвата и собирать то, что мы хотим, возможно, с выражением, похожим на:
(INFO|DEBUG|WARNING|ERROR)\s+?(\d{2}\/\d{2}\/\d{4})\s+?(\d{2}:\d{2}:\d{2})\s+?([A-Z]{2})\s+?(<(.+?)>)
Тест
# coding=utf8
# the above tag defines encoding for this document and is for Python 2.x compatibility
import re
regex = r"(INFO|DEBUG|WARNING|ERROR)\s+?(\d{2}\/\d{2}\/\d{4})\s+?(\d{2}:\d{2}:\d{2})\s+?([A-Z]{2})\s+?(<.+?>)"
test_str = ("INFO 01/23/2019 01:49:48 PM <some message>INFO 01/23/2019 01:49:48 PM <some message>\n"
"INFO 01/23/2019 01:49:48 PM <some message>DEBUG 01/23/2019 01:49:48 PM <some message>\n"
"INFO 01/23/2019 01:49:48 PM <some message>INFO 01/23/2019 01:49:48 PM <some message>\n"
"WARNING 01/23/2019 01:49:48 PM <some message>ERROR 01/23/2019 01:49:48 PM <some message>")
matches = re.finditer(regex, test_str, re.MULTILINE)
for matchNum, match in enumerate(matches, start=1):
print ("Match {matchNum} was found at {start}-{end}: {match}".format(matchNum = matchNum, start = match.start(), end = match.end(), match = match.group()))
for groupNum in range(0, len(match.groups())):
groupNum = groupNum + 1
print ("Group {groupNum} found at {start}-{end}: {group}".format(groupNum = groupNum, start = match.start(groupNum), end = match.end(groupNum), group = match.group(groupNum)))
# Note: for Python 2.7 compatibility, use ur"" to prefix the regex and u"" to prefix the test string and substitution.
Схема RegEx
jex.im визуализирует регулярные выражения:

Демо
Этот фрагмент показывает, как работают группы захвата:
const regex = /(INFO|DEBUG|WARNING|ERROR)\s+?(\d{2}\/\d{2}\/\d{4})\s+?(\d{2}:\d{2}:\d{2})\s+?([A-Z]{2})\s+?(<.+?>)/gm;
const str = `INFO 01/23/2019 01:49:48 PM <some message>INFO 01/23/2019 01:49:48 PM <some message>
INFO 01/23/2019 01:49:48 PM <some message>DEBUG 01/23/2019 01:49:48 PM <some message>
INFO 01/23/2019 01:49:48 PM <some message>INFO 01/23/2019 01:49:48 PM <some message>
WARNING 01/23/2019 01:49:48 PM <some message>ERROR 01/23/2019 01:49:48 PM <some message>`;
let m;
while ((m = regex.exec(str)) !== null) {
// This is necessary to avoid infinite loops with zero-width matches
if (m.index === regex.lastIndex) {
regex.lastIndex++;
}
// The result can be accessed through the `m`-variable.
m.forEach((match, groupIndex) => {
console.log(`Found match, group ${groupIndex}: ${match}`);
});
}