Regular Expressions 101

Community Patterns

smartctl regex

1

Regular Expression
PCRE2 (PHP >=7.3)

/
^\s*(\d{1,3})\s+([\w-]+)\s+(0x[\da-fA-F]{4})\s+(\d{3})\s+(\d{3})\s+(\d+)\s+([\w-]+)\s+(\w+)\s+-\s+(\d+)
/
gm

Description

Regex for smartctl output

Submitted by anonymous - a year ago