当前位置:网站首页>JS regular expression matches IP address (IP address regular expression verification)
JS regular expression matches IP address (IP address regular expression verification)
2022-07-25 23:06:00 【Full stack programmer webmaster】
Hello everyone , I meet you again , I'm your friend, Quan Jun .
let reg = /https:\/\/.*\.[0-9]{1,4}(:[\w]+)?/gThe result of this regular match is as follows
https://101.122.134.40:8860/aa.bb/aa/ee
> https://10.162.123.40:8860
https://101.122.134.40/aa.bb/aa/ee
> https://101.122.134.40Then replace it
let str = 'https://101.122.134.40:8860/aa.bb/aa/ee'
let reg = /https:\/\/.*\.[0-9]{1,4}(:[\w]+)?/g
str.replace(reg,'www.xxx.com')Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/127898.html Link to the original text :https://javaforall.cn
边栏推荐
- Sichuan cuisine menu (I)
- [tensorflow] about seed
- 每周推荐短视频:需要协同的智能设备越来越多,给物联网开发提出更大挑战?
- Network security and level protection
- Hj9 extract non duplicate integers
- Zero crossing position search of discrete data (array)
- QT operation to solve large amount of duplicate data
- 2020-09-17
- Tree view model example of QT
- [interface performance optimization] reasons for index failure and how to optimize SQL
猜你喜欢

内存分页与调优,内核与用户空间

CMU AI PhD first year summary

Mysql数据类型

Network Security Learning (XIV) IP protocol

The fourth experiment nat

Websocket summary

5 ROS simulation modeling (3-rviz+gazebo+ control simulation robot)

自定义mvc原理

Kibana~ the process number cannot be found after kibana is started in the background

Kibana~后台启动Kibana之后无法找到进程号
随机推荐
Memory paging and tuning, kernel and user space
The difference between abstract classes and interface interfaces
Hcie is finally in hand, and the road begins
Check code generation
2020-09-17
Network Security Learning (16)
Expression of directional signal -- complex exponential signal
PE format: analyze and implement IATHOOK
【自然语言处理】【向量表示】AugSBERT:改善用于成对句子评分任务的Bi-Encoders的数据增强方法
Websocket summary
Design of regular expressions
The difference between overloading and rewriting
QT string operation
互联网协议之 IPFS
QVariant的使用
Madness. MySQL learning.
码蹄集 万民堂大厨
Network Security Learning (XV) ARP
Data filtering of MATLAB
[opencv] edge detection [API and source code implementation]