如何搜索所有以某种模式开头但后面没有其他模式的行?
How to search for all lines that start with a pattern, but then don't have another following pattern?
我要的select离子是:
pushbutton.*
但我不想要任何包含 'justify_cell' 的 selection
(?!.*justify_cell)
我可以得到 select 所有不包含 'justify_cell'
的行
^(?!.*justify_cell).*$
但如果不包含 'justify_cell'
,我似乎无法找到从按钮到行尾 select 的方法
我是个傻瓜 - 但基本答案似乎是:
^(?!.*justify_cell).*(pushbutton.*)$
我要的select离子是:
pushbutton.*
但我不想要任何包含 'justify_cell' 的 selection
(?!.*justify_cell)
我可以得到 select 所有不包含 'justify_cell'
的行^(?!.*justify_cell).*$
但如果不包含 'justify_cell'
,我似乎无法找到从按钮到行尾 select 的方法我是个傻瓜 - 但基本答案似乎是:
^(?!.*justify_cell).*(pushbutton.*)$