480 |
--regex=[@var{@{language@}}]/@var{tagregexp}/[@var{nameregexp}/]@var{modifiers} |
--regex=[@var{@{language@}}]/@var{tagregexp}/[@var{nameregexp}/]@var{modifiers} |
481 |
@end smallexample |
@end smallexample |
482 |
|
|
483 |
or else: |
@noindent |
484 |
|
or else: |
485 |
|
|
486 |
@smallexample |
@smallexample |
487 |
--regex=@@@var{regexfile} |
--regex=@@@var{regexfile} |
488 |
@end smallexample |
@end smallexample |
489 |
|
|
490 |
@noindent |
@noindent |
491 |
where @var{tagregexp} is used to find the tags. It is always |
where @var{tagregexp} is a regular expression used to find the tags. |
492 |
|
It is always |
493 |
anchored, that is, it behaves as if preceded by @samp{^}. If you want |
anchored, that is, it behaves as if preceded by @samp{^}. If you want |
494 |
to account for indentation, just match any initial number of blanks by |
to account for indentation, just match any initial number of blanks by |
495 |
beginning your regular expression with @samp{[ \t]*}. In the regular |
beginning your regular expression with @samp{[ \t]*}. In the regular |
518 |
VT (vertical tab). |
VT (vertical tab). |
519 |
@end table |
@end table |
520 |
|
|
521 |
The syntax of regular expressions in @code{etags} is the same as in |
@noindent |
522 |
|
The syntax of regular expressions in @code{etags} is the same as in |
523 |
Emacs. |
Emacs. |
524 |
|
|
525 |
You should not match more characters with @var{tagregexp} than that |
You should not match more characters with @var{tagregexp} than that |
530 |
accurately and to do completion on tag names more reliably. You can |
accurately and to do completion on tag names more reliably. You can |
531 |
find some examples below. |
find some examples below. |
532 |
|
|
533 |
A @samp{--regex} option can be restricted to match only files of a |
The suggested separator character used to delimit @var{tagregexp} |
534 |
given language using the optional prefix @var{@{language@}}. This is |
and @var{nameregex} is @samp{/}, as in the example above. However, |
535 |
particularly useful when storing many predefined regular expressions |
you can use any other character as a separator, as long as it is |
536 |
for @code{etags} in a file. |
different from space, tab, braces or the @samp{@@} character. If you |
537 |
|
need to use the separator as part of the regular expression, you must |
538 |
|
precede it by the @samp{\} character. |
539 |
|
|
540 |
The @var{modifiers} are a sequence of 0 or more characters that |
The @var{modifiers} are a sequence of 0 or more characters that |
541 |
modify the way @code{etags} does the matching. Without modifiers, |
modify the way @code{etags} does the matching for that particular |
542 |
each regexp is applied sequentially to each line of the input file, in |
@samp{--regex} option. Without modifiers, the regular expression |
543 |
|
is applied sequentially to each line of the input file, in |
544 |
a case-sensitive way. The modifiers and their meanings are: |
a case-sensitive way. The modifiers and their meanings are: |
545 |
|
|
546 |
@table @samp |
@table @samp |
547 |
@item i |
@item i |
548 |
ignore case when matching. |
ignore case when matching. |
549 |
@item m |
@item m |
550 |
do not match line by line; rather, match the whole file, so that |
do not match line by line; rather, match this regular expression |
551 |
multi-line matches are possible. |
against the whole file, so that multi-line matches are possible. |
552 |
@item s |
@item s |
553 |
implies @samp{m}, and causes dots in @var{tagregexp} to match newlines |
implies @samp{m}, and causes dots in @var{tagregexp} to match newlines |
554 |
as well. |
as well. |
555 |
@end table |
@end table |
556 |
|
|
557 |
A @var{regexfile} is the name of a file where regular expressions |
A @var{regexfile} is the name of a file where the arguments of |
558 |
are stored, one per line. Lines beginning with space or tab are |
@samp{--regex} options are stored, one per line. The syntax is the |
559 |
ignored, and can be used for adding comments. |
same as the one used for the @samp{--regex} option, without the |
560 |
|
initial @samp{--regex=} part. Lines beginning with space or tab are |
561 |
|
ignored: they can be used to include comments in the @var{regexfile}. |
562 |
|
|
563 |
The @samp{-R} option deletes all the regexps defined with |
The @samp{-R} option deletes all the regexps defined with |
564 |
@samp{--regex} options. It applies to the file names following it, as |
@samp{--regex} options. It applies to the file names following it, as |
565 |
you can see from the following example: |
you can see from the following example: |
566 |
|
|
567 |
@smallexample |
@smallexample |
568 |
etags --regex=/@var{reg1}/ voo.doo --regex=/@var{reg2}/ \ |
etags --regex=/@var{reg1}/i voo.doo --regex=/@var{reg2}/m \ |
569 |
bar.ber -R --lang=lisp los.er |
bar.ber -R --lang=lisp los.er |
570 |
@end smallexample |
@end smallexample |
571 |
|
|
574 |
@file{bar.ber} according to their contents. @code{etags} also uses |
@file{bar.ber} according to their contents. @code{etags} also uses |
575 |
@var{reg1} to recognize additional tags in @file{voo.doo}, and both |
@var{reg1} to recognize additional tags in @file{voo.doo}, and both |
576 |
@var{reg1} and @var{reg2} to recognize additional tags in |
@var{reg1} and @var{reg2} to recognize additional tags in |
577 |
@file{bar.ber}. @code{etags} uses the Lisp tags rules, and no regexp |
@file{bar.ber}. @var{reg1} is checked against each line of |
578 |
matching, to recognize tags in @file{los.er}. |
@file{voo.doo} and @file{bar.ber}, in a case-insensitive way, while |
579 |
|
@var{reg2} is checked against the whole @file{bar.ber} file, |
580 |
|
permitting multi-line matches, in a case-sensitive way. @code{etags} |
581 |
|
uses the Lisp tags rules, and no regexp matching, to recognize tags in |
582 |
|
@file{los.er}. |
583 |
|
|
584 |
You can specify a regular expression for a particular language, by |
A @samp{--regex} option can be restricted to match only files of a |
585 |
writing @samp{@{lang@}} in front of it. Then @code{etags} will use |
given language using the optional prefix @var{@{language@}}. |
586 |
the regular expression only for files of that language. (@samp{etags |
(@samp{etags --help} prints the list of languages recognized by |
587 |
--help} prints the list of languages recognized by @code{etags}.) The |
@code{etags}.) This is particularly useful when storing many |
588 |
|
predefined regular expressions for @code{etags} in a file. The |
589 |
following example tags the @code{DEFVAR} macros in the Emacs source |
following example tags the @code{DEFVAR} macros in the Emacs source |
590 |
files, for the C language only: |
files, for the C language only: |
591 |
|
|