I’m trying to delete all text in lines from the 2nd character till the last .word\ pattern (deleting also the dot), but there may not be a \ before the dot. If there is a \ before the dot then delete till the previous .word\ pattern.
I created this simple regex:
^\w\zs.*[^\]\.\ze\w\+\\\s.*$
but this doesn’t work
What did I wrong?
What would be the code if I don’t want to delete till the last .word\ but till the 2nd .word\ pattern?
data:
nnoremenu <silent> 97.330.10 &Sort.Reverse\ Characters.Reverse\ Characters\ in\ Line\ Hor\ -[A]<Tab>sihT\ si\ ym\ txet\.\
nnoremenu <silent> 97.330.11 &Sort.Reverse\ Characters.Reverse\ Characters\ in\ Line\ Hor\ Reverse\ -[A]<Tab>\.txet\ ym\ si\ sihT\
must be:
n Reverse\ Characters\ in\ Line\ Hor\ -[A]<Tab>sihT\ si\ ym\ txet\.\
n Reverse\ Characters\ in\ Line\ Hor\ Reverse\ -[A]<Tab>\.txet\ ym\ si\ sihT\
You should use:
Note that the final
\smeans that you require a space after the last backslash.The
\@<!helper means: lookbehind negative assertion (see:help /\@<!).Also note that the final
.*$is useless.