आगे बढ़े या उसके बाद?
यदि यह 'abc' से शुरू हो रहा है जो 'defg' के बाद (तुरंत) नहीं है, तो आप bmdhacks 'समाधान ।
यदि यह 'abc' से शुरू हो रहा है जो 'defg' से पहले नहीं है (तुरंत), तो आप नकारात्मक दिखना चाहते हैं:
/\%(defg\)\@
This will match any occurance of 'abc ' as long as it's not part of 'defgabc '. See :help \@ for more details.
यदि आप 'abc' से मिलान करना चाहते हैं, जब तक कि यह 'defg। * Abc' का हिस्सा न हो, तो बस एक । *
जोड़ें:
/\%(defg.*\)\@
'Abc' मिलान केवल उन पंक्तियों पर जहां 'defg' नहीं होता है समान है:
/\%(defg.*\)\@
Although, if you're just doing this for a substitution, you can make this easier by combining :v//
and :s//
:%v/defg/s/abc //g
This will substitute '' for 'abc ' on all lines that don't contain 'defg'. See :help :v
for more.