Re: [Ctags] lookahead operators supported?
Brought to you by:
dhiebert
From: Elliott H. <en...@je...> - 2007-04-03 04:28:11
|
On Mon, 2007-04-02 at 23:47 -0400, Joseph Xu wrote: > I'm trying to define some tags for a custom language, and I was > wondering of negative lookahead operators of the type (?!<regex>) is > supported by ctags. I tried a regex like this: > > /^\(\s*<=\s*\(\s*(?!next)([a-zA-Z0-9_]+)/\1/e,elab/ > > and got the message "ctags: Warning: Invalid preceding regular expression". > > But if I remove the negative lookahead and use this: > > /^\(\s*<=\s*\(\s*([a-zA-Z0-9_]+)/\1/e,elab/ > > it works fine. Am I using the right syntax? ctags uses regcomp(3), which only supports "POSIX" regular expressions. see the output of "man 7 regex" on a Linux box for details. if you need a more Perl-like ctags, you could use the PCRE library. i think you should be able to just change ctags' #includes to grab <pcreposix.h>. -- Elliott Hughes, http://www.jessies.org/~enh/ |