Re: [Ctags] regex question
Brought to you by:
dhiebert
From: Darren H. <dar...@te...> - 2001-08-23 05:57:12
|
On Tue, 21 Aug 2001, Johannes Zellner wrote: > the following pattern: > > --regex-basic=/^[ \t]*(private[ \t]+)?(sub|function)[ \t]+([^( \t]+)/\3/r,regex/ei > ... > a tag file like this (note that there are tag entries ABOVE THE HEADER) > > Macro1.sba /^Sub Main$/;" r > Macro2.bas /^Sub Main$/;" r > PolyMAXpci01.sba /^Sub Main$/;" r > syn.sba /^Sub Main$/;" r > !_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/ > ... > If I add a space after 'Sub Main ' everything's ok. > Apparently the regex replacement \3 evaluates to an empty string. > Is this a bug ? You regex pattern specifies use of the third grouping as the tag name. This is the group "([^( \t]+)", which is always one or more of the characters '(', ' ', or '\t'. So you got what you specified. However, ctags shouldn't be letting you do this, so it would seem that this is a bug. I will have to trim leading and trailing spaces from the tag name before checking for an empty tag name. -- Darren Hiebert <da...@hi...> http://darren.hiebert.com |