Advertisement
mightyroot

Regexp search IP and MAC

Jan 25th, 2013
301
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.16 KB | None | 0 0
  1. ----{ IP address }-----
  2.  
  3. grep -E -o '[0-9]{1,3}(\.[0-9]{1,3}){3}'
  4.  
  5. ----{ MAC address }-----
  6.  
  7. grep -E -o '[0-9,aAbBcCdDeEfF]{1,2}(\:[0-9,aAbBcCdDeEfF;]{1,3}){5}'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement