Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE2 (PHP >=7.3)

/
(?P<device_name>\w+)(?P<is_connected> (connected|disconnected))(?P<is_primary> primary)? ((?P<resolution_width>\d+)x(?P<resolution_height>\d+)\+(?P<offset_width>\d+)\+(?P<offset_height>\d+)) \(normal left inverted right x axis y axis\) ((?P<dimension_width>\d+)mm x (?P<dimension_height>\d+)mm)?
/
gm

Description

Device line of xrandr output

Submitted by anonymous - 3 years ago