Robert Mark Bram wrote:
>
> Can anyone guide me as to how I can modify the ".*" in the above
> expression to deal with new line chars too?
just prefix it with "\_", i.e., make it "\_.*".
And you probably want to put backslashes before "(", ")", and "+".
Regards,
Jürgen
--
Sometimes I think the surest sign that intelligent life exists elsewhere
in the universe is that none of it has tried to contact us. (Calvin)
Yes, and beware that the star multi is greedy, i.e., if you have several
matched begin- and end-patterns in the file, begin\_.*end will always
match with the _last_ "end" in the file, gobbling up any number of
begin-end blocks in between. \_.{-} will match as few of "anything
including a line break" as possible, which might be better suited to
your needs here. See ":help /multi".
Best regards,
Tony.
--
The debate rages on: Is PL/I Bachtrian or Dromedary?
The problem with the suggestions from others is this is NOT a vim regex.
This is executed by ctags.exe, so you have to use Perl reg
expressions, not Vim ones.
Maybe the ones provided do work with Perl, but I don't think so.
I am not certain what the equivalent of Vim's \_.* is in Perl. Anyone?
As an alterative, do you really need to scan up to the closing >?
Just remove the closing > in the pattern.
--langdef=ant
--langmap=ant:.xml
--regex-ant=/^[ \t]*<[ \t]*project.*name="([^"]+)".*/\1/p,project/i
--regex-ant=/^[ \t]*<[ \t]*target.*name="([^"]+)".*/\1/t,target/i
And that should probably do it.
If so, let me know and I will update the Tip.
Dave
The equivalent in Perl is to supply the s flag to the match.
i.e. "\n" =~ m/./s;
--
Erik Falor
Registered Linux User #445632 http://counter.li.org
On my system, "man ctags" for version 5.5.4 says nothing about
Perl--it says it uses Posix extended regular expressions, "roughly
that used by egrep(1)".
Regards,
Gary
Poor choice of words, I said Perl meaning the "default standard".
So, really based on Erik's response, what we need to find is a
compatible egrep regex to span multiple lines.
The alternative is to ignore the closing brace, but we still could
potentially run into cases where the tag name is on a different line
from the initial brace. So, the proper solution is a complete egrep
regex.
Dave