正則取IP地址
[root@10-13-9-63 ~]# ifconfig eth0 | grep -Eo '([0-9]{1,3}.){3}[0-9]{1,3}' | head -1
10.13.9.63
[0-9]數字範圍,因爲IP表示爲XXX三位數字組成,{1,3}就表示數字範圍。([0-9]{1,3}.)引用成整體,地址出現三次{3}。
10.13.9.63
[0-9]數字範圍,因爲IP表示爲XXX三位數字組成,{1,3}就表示數字範圍。([0-9]{1,3}.)引用成整體,地址出現三次{3}。
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章
SGDMA與普通DMA
藍天上的雲℡
2024-05-02 14:21:20
用json來存數據的思路. json類型數據庫的思路.
張博的博客
2024-05-02 14:19:50
Vue | babel.config.js 配置詳解
emanlee
2024-05-02 14:10:29
Vue項目中main.js、App.vue、import...from...等的作用和意義
emanlee
2024-05-02 14:10:29
Vue .eslintignore
emanlee
2024-05-02 14:10:29
Vue mockjs mock.js
emanlee
2024-05-02 14:10:29
Vue .gitignore
emanlee
2024-05-02 14:10:29
vue 項目構建之 jsconfig.json 作用
emanlee
2024-05-02 14:10:29
Vue .eslintrc.js
emanlee
2024-05-02 14:10:29
Vue 生命週期 Vue進階(三十六):created() 詳解
emanlee
2024-05-02 14:10:29
Vue .browserslistrc
emanlee
2024-05-02 14:10:29
前端Vue 啓動過程 啓動流程 執行流程
emanlee
2024-05-02 14:10:29