2016-01-17 12:32 GMT+03:00 Axel Bender <[email protected]>:

> Given the following two files, it seems that a "\(...\)" matching group
> prevents the pattern from matching:
>
> [man.txt] (please note that this is supposed to be
> a man page, so the special chars are really 0x8s!
> ---------------------------------------
>       ( (M M- -T TA AB B) )
> ---------------------------------------
>
> [man.vim]
> ---------------------------------------
> syntax clear
>
> " Try these in order:
>
> """"" Ok """""
> "yntax match  manKey  "(\b(\([CM]\)\b\1-\b-[^)]*)\b)"
>
> """"" As I don't need the parens, I added a matching group "\(...\)" at
> the beginning ("\@<=" is not yet present!) """""
> "yntax match  manKey  "\((\b(\)\([CM]\)\b\1-\b-[^)]*)\b)"
>
> """"" This works """""
> "yntax match  manKey  "(\b(\([CM]\)\b\1-\b-[^)]*)\b)"hs=s+3,he=e-3
>
> highlight     manKey  guibg=black guifg=white
> ---------------------------------------
>

​This should go to vim-use, not vim-dev. Regular expression is working
completely correct, just ask yourself (or documentation) what does `\1`​ in
regex mean.

You should not use \(\) unless you do mean to use matched part somewhere.
If you do not use \%(\) ((?:) in Perl-like regexes).



>
> --
> --
> You received this message from the "vim_dev" 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
>
> ---
> You received this message because you are subscribed to the Google Groups
> "vim_dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
-- 
You received this message from the "vim_dev" 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

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui