Wednesday, May 9, 2012

Re: highlight groups defintion

Hi sinbad!

On Di, 08 Mai 2012, sinbad wrote:

> i am trying to write a regular expression to search
> for the c function, the following doesnt seem to work
> very well.
>
> [a-z|_|0-9]\+(.\+[^\r\n]\+);\C
>
> for exmaple, in the following example the above re
> is selecting the whole text startnig from new_func
> till end-of-file. what's wrong with re ?
>
> code
> code
> new_func(int a, int b);
> code
> code
> end-of-file

For me, your regular expression matches just what you want, however it
looks kind of strange:

> [a-z|_|0-9]\+(.\+[^\r\n]\+);\C

1) What are the 2 | in the first collation for? I think you can leave
them out.
2) the [^\r\n] is not needed I believe, since collations usually don't
match line breaks. See :h /\_ for details,

regards,
Christian
--
Was die Leute gemeiniglich als Schicksal nennen, sind meistens nur
ihre eigenen dummen Streiche.
-- Arthur Schopenhauer

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