Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
PCRE2 (PHP >=7.3)

/
([-]+[Uu](sername|ser|SERNAME|SER)?\s+[^\s]+\s[-]+[Pp](ass|assword|ASS|ASSWORD)?\s([\"\'])?)([^\s\"\']+)
/
gmi

Description

Regex to find cleartext passwords in logs in various formats

Submitted by anonymous - 2 years ago