Home | 简体中文 | 繁体中文 | 杂文 | Github | 知乎专栏 | 51CTO学院 | CSDN程序员研修院 | OSChina 博客 | 腾讯云社区 | 阿里云栖社区 | Facebook | Linkedin | Youtube | 打赏(Donations) | About
知乎专栏多维度架构

第 36 章 Regular expression (正则表达式)

目录

36.1. Network 网络地址处理
36.2. HTML 处理

36.1. Network 网络地址处理

		
$ wget -q -O - checkip.dyndns.org|sed -e 's/.*Current IP Address: //' -e 's/<.*$//'
202.130.101.34

$ curl -q -s http://checkip.dyndns.org | egrep -o '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+'
202.130.101.34

$ curl -q -s http://checkip.dyndns.org | egrep -o '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}'
202.130.101.34