Running Windows 10 (Home) and
VIM - Vi IMproved 8.1 (2018 May 18, compiled May 18 2018 18:36:07)
MS-Windows 32-bit GUI version with OLE support
Included patches: 1
Compiled by mool@tororo.
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 example below:
Using \+
-or \*
will not work for me in the following example
Original 01 --> Theft Attempted or Completed Offense? Completed
Original 02 --> Theft Attempted or Completed Offense? Attempted
Because the words Completed
and Attempted
randomly alternate on various lines, I was hoping \u\w\+
would help. No matter what I try, once I employ \+
or \*
, that line of code/script fails:
" Broken
:%s/\v\s(Attempted or Completed Offense\?)\s(\u\w\+)\s/,\1,\2,/g
" Working
:%s/\v\s(Attempted or Completed Offense\?)\s(\u\w.......)\s/,\1,\2,/g
I cannot find a written reason for this failure.
\v
, use+
instead of\+
:h /magic
and:h pattern-overview
and the following sections ofpattern.txt