假设我们有类似这样的行,也包含其他内容
0000000470{201906037143845092 xyz....
0000000470{201906037143845092 abc,,,,
0000000470{201906037143845092 pqr////
假设我只想删除包含201906037143845092的整行 你能帮我吗?
我希望结果中除包含201906037143845092的行以外,还有其他行
答案 0 :(得分:0)
^.*201906037143845092.*(?:\R|$)
LEAVE EMPTY
. matches newline
说明:
^ # beginning of line
.* # 0 or more any character butt newline
201906037143845092 # the string to search
.* # 0 or more any character butt newline
(?:\R|$) # any kind of linebreak OR end of line
给出:
0000000470{201906037143845092 xyz....
0000000470{201906037143845092 abc,,,,
0000000470{201906037143845092 pqr////
0000000470{201806037143845092 xyz....
0000000470{201706037143845092 abc,,,,
0000000470{201606037143845092 pqr////
给定示例的结果
0000000470{201806037143845092 xyz....
0000000470{201706037143845092 abc,,,,
0000000470{201606037143845092 pqr////
屏幕截图:
之前:
之后: