On 2022-03-09, LOSS PREVENTION <
980bea...@gmail.com> wrote:
> I have read, both
http://www.vimregex.com/ -and- various sections of
>
http://vimdoc.sourceforge.net/htmldoc/help.html. That said, I just can't
> figure out what I'm doing incorrectly. Please follow the live examples
> below:
>
> 1) Using \+ is not working for me in the following example -
> Original 01 --> Theft Attempted or Completed Offense? Completed
> Original 02 --> Theft Attempted or Completed Offense? Attempted
> Broken --> %s/\v\s(Attempted or Completed Offense\?)\s(\u\w\+)\s/,\1,\2,/g
With \v, you should use + instead of \+.
> I cannot find a written reason for this failure.
I have taken a quick look at the help of \v and, in fact, I cannot find that
difference explained in the table. Maybe, it should.
> --Next--
>
> %s/^M//g <--will work from the cmd-line, how do I do this from within a
><script>.vim?
That is an ex command: it works in exactly the same way in a script.
Life.