Wednesday, September 1, 2010

Re: RegEx help

This should do it.  Obviously I'm just doing a basic substitution so you can alter as you need to.

s/"\(John\s\+Travolta\)"\s\+\(samuel\)\s\+\(jackson\)/\1\r\2\r\3/i

~Adam~


On Wed, Sep 1, 2010 at 12:00, Kunal Bajpai <kunal.bajpai@gmail.com> wrote:
The string is (including double quotes) - "John Travolta" Samuel
Jackson

I want RegEx that searches the above string and treats John Travolta
(between quotes) as one string and Samuel & Jackson as the other 2
string.

Thus,
String 1 = John Travolta
String 2 = Samuel
String 3 = Jackson

Actually, I have to use the RegEx in a function where "space" is a
delimiter and splits a string into sub-strings

TIA
Kunal

--
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 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

No comments:

Post a Comment