Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE (PHP <7.3)

/
^\s*(\d+)?\s?([rwxSTstdcb\-lp?]{10})\s+(\d+)?\s?(\S+)\s+(\S+)\s+([0-9,]+)?\s+(\d+)?\s?([0-9\-]{10}\s+[0-9:]{5}|[A-Z][a-z]{2}\s+[0-9]{1,2}\s+[0-9:]{4,5})\s((?:(?!\s\->\s).)*)(\s\->\s)?(.*)
/
gm

Description

WARNING: regex is uglier than your mom.

Submitted by Jared Rummler - 8 years ago