[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Etags and regexps

From: Eli Zaretskii
Subject: Re: Etags and regexps
Date: Sat, 20 Jul 2019 12:48:11 +0300

> From: Pascal Quesseveur <address@hidden>
> Date: Mon, 15 Jul 2019 16:46:39 +0200
> I am trying to set regexps to let etags recognize tags from Object
> Pascal code. For ex. the following regexp;
> /^[[:space:]]*type[[:space:]]+\([^ \t=]+\)/\1/
> applied to a type declaration:
> type MyType = class(TObject)
> matches class MyType. I am now trying to match declarations on
> multiple lines, for ex.:
> type
>   MyType = class(TObject)
> I have tried to put a new line in my regexp and use m modifier in
> etags regexp but it doesn't work (emacs 24 & 26.2). When i add a m
> modifier to the original regexp which doesn't contain newlines, it
> doesn't work anymore.
> So how are we supposed to use m modifier?

The problem is with the leading "^" in your regexp: remove it, and
everything will work as you expect.  Etags always matches the regexp
anchored, i.e. it prepends "^" to it, so that "^" confuses the regexp

reply via email to

[Prev in Thread] Current Thread [Next in Thread]