Regular Expressions 101

Community Patterns

Community Library Entry

2

Regular Expression
PCRE (PHP <7.3)

/
^(?<ip>[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}).*(?<mac>..:..:..:..:..:..)\s*.\s*(?<interface>.*)$
/
m

Description

Matches cat /proc/net/arp. It returns the IP, MAC and interface.

Submitted by anonymous - 9 years ago