regex question

2006-06-01 Thread Eric Arnold
Sorry if I've got brain lock on this, but is it possible to match a substring like match wildmenu ;\(directory\)\{3,}; such that it will match three or more substring chars of the pattern to match "dir" as well as "directory"? (I know the above format isn't this.) I know I could do it if I cou

Re: regex question

2006-06-01 Thread Cory Echols
On 6/1/06, Eric Arnold <[EMAIL PROTECTED]> wrote: Sorry if I've got brain lock on this, but is it possible to match a substring like match wildmenu ;\(directory\)\{3,}; such that it will match three or more substring chars of the pattern to match "dir" as well as "directory"? (I know the above

Re: regex question

2006-06-01 Thread Benji Fisher
On Thu, Jun 01, 2006 at 05:05:00AM -0600, Eric Arnold wrote: > Sorry if I've got brain lock on this, but is it possible to match a > substring like > > match wildmenu ;\(directory\)\{3,}; > > such that it will match three or more substring chars of the pattern > to match "dir" as well as "directo

Re: regex question

2006-06-01 Thread Eric Arnold
On 6/1/06, Benji Fisher <[EMAIL PROTECTED]> wrote: On Thu, Jun 01, 2006 at 05:05:00AM -0600, Eric Arnold wrote: > Sorry if I've got brain lock on this, but is it possible to match a > substring like > > match wildmenu ;\(directory\)\{3,}; > > such that it will match three or more substring chars

Re: regex question

2006-06-01 Thread Eric Arnold
Sorry I wasn't clear, I wanted it to match any substring of 'directory'. I think \%[] does this (courtesy of Benji). On 6/1/06, Cory Echols <[EMAIL PROTECTED]> wrote: On 6/1/06, Eric Arnold <[EMAIL PROTECTED]> wrote: > Sorry if I've got brain lock on this, but is it possible to match a > su

Re: regex question

2006-06-06 Thread Charles E Campbell Jr
Eric Arnold wrote: Real close. Turns out I think I want: /\<\%[directory]\{1,}\>/ I suspect you want /\/ but it doesn't seem to recognize \{1,} and without the \< it seems to be matching white space. The problem with \< is that it doesn't seem to allow \<\%[.directory] What I'm a

Re: regex question

2006-06-06 Thread Charles E Campbell Jr
Eric Arnold wrote: Real close. Turns out I think I want: /\<\%[directory]\{1,}\>/ I suspect you want /\/ Regards, Chip Campbell

quick regex question

2006-08-04 Thread Ben lemasurier
Hey everyone, I work with someone who formats their code like this: if(asafdlkasdf) { asdfasf } i write like this: if(asdfasfd) { safasdf } I wrote a little regex to fix the ") _newline_ { _newline_" problem but I am getting strange results here is the regex: %s/)\s*\n\s*{\n/) {\n/ig

Re: quick regex question

2006-08-04 Thread Tim Chase
here is the regex: %s/)\s*\n\s*{\n/) {\n/ig It runs through but my code is getting formatted like this now if(asdf) { ^@ nextline_of_code _newline_ Vim uses various represenations at different points for nulls and for newlines. Just change the "\n" in your replacement portion to "\r", maki

Re: quick regex question

2006-08-04 Thread A.J.Mechelynck
Tim Chase wrote: here is the regex: %s/)\s*\n\s*{\n/) {\n/ig It runs through but my code is getting formatted like this now if(asdf) { ^@ nextline_of_code _newline_ Vim uses various represenations at different points for nulls and for newlines. Just change the "\n" in your replacement port