On Fri, September 25, 2009 7:43 am, Jeremy Conlin wrote:
> I know there are some regex wizards out there, I am in need of your help.
> I have lines in my file that look like one of the following two
>
> Some text & more text & (some white space) & ...
> Some text & more text & (some numbers, :, or -) & ...
>
> For the life of me I can't get my regular expression to differentiate
> between the two.  This is what I tried (but it found both lines):
>
> \_^\(.\{-}\s&.\{-}&\s*\)\(\s\{-}[\d:-]\{1,}\)

You are at least missing the paranthesis in your pattern and I believe
the \d form is not valid inside []. Using the following pattern

^\(.\{-}\s&.\{-}&\s*\)\((\s\{-}[0-9:-]\{1,})\)

works, assuming you want to match the following line:
Some text & more text & (12349:-) & ...

regards,
Christian
-- 
:wq!


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

Reply via email to