Regular Expressions 101

Community Patterns

Linux ARP-Table

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 - 8 years ago