Thursday, January 7, 2010

Re: non-trivial regexp needed, please help

Thank you very much for all the responses Tim, Matt and Christian, problem solved!
This below suggested by Matt is good enough and flexible, and yes, it could be automated as per Christian suggested, but I would go for it as it is, it is just a few keystrokes overhead.
Search highlight is a bit weird if turned on, but that is not important at all here, goal is to find a line quickly in a huge file.
 
Once again, thank you very much.
 
Have a nice day,
  Peter

2010/1/4 Matt Wozniski <mjw@drexel.edu>
On Mon, Jan 4, 2010 at 1:12 PM, Tim Chase wrote:
>> I am trying to put together a regexp to find pieces of text within one line,
>> but I do not know their order.
...
>> Also, best if it would be flexible enough to support arbitrary number of
>> samples without much typing.
>
> I don't think there's a natively nice way to do this

If I'm understanding the problem correctly, I think you're looking for \&

 /.*apple\&.*banana\&.*carrot

See :help /\&

~Matt

--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php

No comments: