一个获取本机ip地址的正则

ifconfig|grep -oP '(?<=inet addr:)(?=(?!127\.0\.0\.1))\d+(\.\d+){3}'

posted @ 2018-07-16 18:20  张不正  阅读(193)  评论(0编辑  收藏  举报
返回顶部