Answers:
这将匹配以NEW开头的所有行,并在行中的某处包含斜杠。
^NEW\b.*/.*\K$
-reg
. matches newline
说明:
^ : begining of string
NEW\b : literally "NEW", followed by a word boundary to not match NEWLY
.*/.* : at least a slash in the line
\K : forget all we have seen until this position
$ : end of string
给出示例的结果:
NEW /RAM-reg
VFXV RAM
NEW /TEST-reg
SDFSDF
DSFDSF
NEW RAM
NEW /RAM /TEST