Regular Expressions 101

Community Patterns

Community Library Entry

3

Regular Expression
Python

r"
time=(\d+\-\d+\-\d+\s+\d+:\d+:\d+)\|action=(\w+)\|[f_name=(\S*)]?\|has_accounting=0
"

Description

f_name may contain spaces, numbers, characters,... so I would go for a [^|] but then I couldn't use [...]? anymore to match the second line?

Submitted by anonymous - 10 years ago