Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
PCRE2 (PHP >=7.3)

/
^\s*(\d{1,3})\s+([a-zA-z0-9-_]+\s?[a-zA-z0-9-_]+)\s+(0x[a-zA-Z0-9]{4})\s+(\d{3})\s+(\d{3})\s+(\d+)\s+([a-zA-z0-9-_]+\s?\w+)\s+(\w+)\s+-\s+(\d+)
/
gm

Description

Regex for smartctl output, but worse.

Submitted by anonymous - 2 years ago