Thanks very much Christian and Andy !!
On Thu, Jun 04, 2009 at 07:00:40PM -0400, Keith Kaple wrote:
>
> Ok, I give up ;-)
>
> I'm trying to write a syntax file for a "pipe" delimeted file, lines look
> something like the example below. I started off ok and got the first number
> and timestamp via syn match, but then thought there is probably an easier way
> to do regexp tagging on the fields based on the delimeter character, but I
> can't seem to figure out the regexp syntax.
>
> 00001 | timestamp | 001| text4 | text5 | text6 | text7 | text8
>
>
> Say I want to define Field4, I was trying stuff like:
>
> syn match FieldFour "^[^|]+|[^|]+|[^|]+|[^|]+|"
>
> which I though would be "any number of anything not a pipe, then a pipe"
> repeated four times. Also tried escaping those pipes in brackets too
> thinking | was interpreted as "or" but not sure if that is correct in this
> flavor of regexp.
>
> Also tried a few unsuccessfull versions of:
>
> syn match FieldFour "^(.*|){5}"
>
> How do you match "just the text after the Nth pipe?"
>
>
> These worked for the first two fields.., but going beyond that without just
> using the occurance of the delimiter somehow probably isn't worth it..
>
> syn match TimeStamp "^\d\d\d\d\d\d\d\d\d| \d\d\d\d/\d\d/\d\d
> \d\d:\d\d:\d\d\.\d\d\d"
> syn match IndexNumber "^\d\d\d\d\d\d\d\d\d" containedin=TimeStamp contained
>
>
> thanks,
>
> Keith
>
>
>
> >
--
| |
. | | | . | | | .
' '
C I S C O
GGSG VoIP
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---