Tuesday, March 8, 2022

New User -- regex question(s) ...

 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

Working --> %s/\v\s(Attempted or Completed Offense\?)\s(\u\w.......)\s/,\1,\2,/g

I cannot find a written reason for this failure.

--Next--

%s/^M//g <--will work from the cmd-line, how do I do this from within a <script>.vim? I'm not understand the help files explanation on this; from a <script>.vim?

Respectfully.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/49e7a378-21d3-48e0-9a31-1ec68ec9f836n%40googlegroups.com.

No comments:

Post a Comment