当前位置:网站首页>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
边栏推荐
- Unity 使用宏
- 单元测试,写起来到底有多痛?
- Common software shortcuts
- Memory paging and tuning, kernel and user space
- 【PMP学习笔记】第1章 PMP体系引论
- What is the difference between bio, NiO and AIO?
- 向下扎根,向上生长,探寻华为云AI的“根”力量
- Analysis of the influence of ESM direction finding error on positioning error
- Websocket summary
- About using NPM command under the terminal, the installation error problem is solved (my own experience)
猜你喜欢

About using NPM command under the terminal, the installation error problem is solved (my own experience)

invalid syntax

通用分页功能

如何获取广告服务流量变现数据,助力广告效果分析?

Express framework

Understanding of forward proxy and reverse proxy
![[文献阅读] - HRL -[HRL with Universal Policies for Multi-Step Robotic Manipulation]](/img/34/06d5ba3af4e6e775a335324c020161.png)
[文献阅读] - HRL -[HRL with Universal Policies for Multi-Step Robotic Manipulation]

Mongodb的特点、与MySQL的差别、以及应用场景

连续三年成为云AI服务领导者,亚马逊云科技做对了什么?
![Explain in detail the addition (+) operation in JS, basic data type addition, reference data type addition, and the underlying operation rules, [] + {}, {} + []](/img/06/85a6ba450fc2637a4ac1cf6a630912.png)
Explain in detail the addition (+) operation in JS, basic data type addition, reference data type addition, and the underlying operation rules, [] + {}, {} + []
随机推荐
Stack and stack class
[PMP learning notes] Chapter 1 Introduction to PMP System
Network Security Learning (11) scanning and blasting
Use of qvariant
Opencv compile and call GPU version
How painful is it to write unit tests?
Summary of common methods of string:
Zero crossing position search of discrete data (array)
TFrecord写入与读取
内存分页与调优,内核与用户空间
向下扎根,向上生长,探寻华为云AI的“根”力量
VisualBox启动虚拟机报错:The VM session was closed before any attempt to power it on.
码蹄集 精准弹幕
第二周学习:卷积神经网络
MathType installation and solution cannot solve the problem of crtl+v
Learning notes of technical art hundred people plan (1) -- basic rendering pipeline
Circle detection and line detection of PCL
[PTA] 7-24 minimum fraction (15 points)
四旋翼飞行器的飞控实现「建议收藏」
Analysis of direction finding error of multi baseline interferometer system