Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE2 (PHP >=7.3)

/
(?<=[&\\?])password=[^&]*&?|&password=[^&]*
/
gm

Description

When logging URLs the passwords that are sent as URL parameters should be masked out to not write them in clear text into the log files.

Submitted by Jan Kessler - 2 years ago