当前位置:网站首页>The regular expression retains [content within the matching range], and then replaces [content outside the matching range]
The regular expression retains [content within the matching range], and then replaces [content outside the matching range]
2022-07-18 07:14:00 【Old_ Driver_ Lee】
One 、 Replace content outside the matching range , Requirements are as follows :
As the title , The current format is :
The rules 40:****
The rules 41:****
The rules 42:****
...
The rules 50:****
The rules 51:****
...
Need to delete the following 4 asterisk , Replace with :( requirement : After deleting the asterisk , The number serial number cannot be changed )
The rules 40:
The rules 41:
The rules 42:
...
The rules 50:
The rules 51:
...
Two 、 The regular expression is :
%s/ The rules \([4-9][0-9]\):\*\*\*\*/ The rules \1:/gc
3、 ... and 、 paraphrase
Command framework :
%s/AAA/BBB/gc This command is a global match AAA, And replace with BBB,
Parameters gc Express : Every time the user enters Y Confirm replacement , Input N Do not replace , The specific meaning will not be repeated
Interpretation of orders :
[4-9][0-9] For matching 2 Characters , The first character range is 4-9, The second character range is 0-9
\([4-9][0-9]\) Symbol \(\) The enclosed part represents a whole expression , hinder \1 It means that the expression is put here intact
remarks :
\(\) The enclosed parts are expressed in sequence 1 expression 2 expression 3 Increasing , This command has only one expression ,\1
Such as :
\(aa\)\(bb\)\(cc\)
among :
aa Expression for 1, Use \1 To call
bb Expression for 2, Use \2 To call
cc Expression for 3, Use \3 To call
\1 Indicates the above \(\) Enclosed expressions
Four 、 Core content : Expression symbols
This deletion / Replace action , Mainly used in regular expressions “ expression ” Options ,
use \(\) Enclosed expressions , Use \1\2\3\... Progressive representation .
\1 It means the first one 1 Expression
\2 It means the first one 2 Expression
\3 It means the first one 3 Expression
...
边栏推荐
- Asymmetric encryption RSA and symmetric encryption AES project application
- Excel import / export annotation General Edition
- MODBUS-RS485布线的8条准则
- C语言:【位域操作】(结构体中使用冒号)
- 08 semi automatic annotation of target detection data set
- 箭头函数的使用
- Compileflow Taobao Workflow Engine
- Makefile variable assignment
- linq 实现查询字符串拼接 : And 和 OR 两种方式
- CSDN中Markdown设置表格列宽度
猜你喜欢

1-first knowledge of FPGA

用命令行登录并操作数据库

毫米波雷达学习(五)——角度估计

8. MySQL -- 触发器
![Centernet (objects as points) [based on tf.slim]](/img/57/9906d367938a6698dc02e026eb61b8.png)
Centernet (objects as points) [based on tf.slim]

Based on taskscheduler and crontask, realize the function of dynamically adding and deleting scheduled tasks
![[interview must brush 101] hash](/img/01/982c24e923563d74436f91dd4f573e.png)
[interview must brush 101] hash

产品-Axure9英文版,使用Repeater中继器实现下拉多选框

(戴尔灵越7572)笔记本外扩显示器以后,笔记本没有声音了的解决办法

非法获利超百万,行业新风口正被破解侵蚀
随机推荐
AB website stress test
flowable 流程自定义属性
Sensor principle article
The IP address of the database is stored. What data type is used
Processing and analysis of yolov3 training data
Enumeration, do you know it?
ab网站压力测试
Is it safe to choose a securities company to open an account for tongdaxin?
英特尔发布开源AI参考套件
Introduction to C language (6)
TP5重写分页
Design and implementation of fingertip Roulette Games (uniapp implements wechat applet)
COMS技术
A-F Codeforces Round #806 (Div.4) A-F题解及代码
linq 实现查询字符串拼接 : And 和 OR 两种方式
ASP.NET里的Session详细解释
C语言:【位域操作】(结构体中使用冒号)
H264 decoding sequence display sequence reference sequence
Typora changes text color and line breaks
8. MySQL -- trigger