Regular Expressions 101

Library entries

Regex to group output of $(ip addr) interface

Vote

1

Regular Expression
python

"
\d: ([\w@]+): <(.+)> mtu (\d+) qdisc (\w+) qlen (\d+)\n[ ]+(\w+\/\w+) ([\d:\w.]+) brd ([\d:\w.]+)\n?(?:(?: )+inet6? ([\d.:\/]+) (?:brd ([\d:\w.]+) )?scope (\w+) (?:\w+)?\n(?: )+valid_lft (\w+) preferred_lft (\w+))?
"
gm

Description

Loading markdown...
Submitted by anonymous - 3 years ago