.\" -*- mode: troff; coding: utf-8 -*-
.\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
.ie n \{\
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds C`
. ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is >0, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{\
. if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. if !\nF==2 \{\
. nr % 0
. nr F 2
. \}
. \}
.\}
.rr rF
.\" ========================================================================
.\"
.IX Title "Regexp::Common::comment 3"
.TH Regexp::Common::comment 3 2023-07-25 "perl v5.38.0" "User Contributed Perl Documentation"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH NAME
Regexp::Common::comment \-\- provide regexes for comments.
.SH SYNOPSIS
.IX Header "SYNOPSIS"
.Vb 1
\& use Regexp::Common qw /comment/;
\&
\& while (<>) {
\& /$RE{comment}{C}/ and print "Contains a C comment\en";
\& /$RE{comment}{C++}/ and print "Contains a C++ comment\en";
\& /$RE{comment}{PHP}/ and print "Contains a PHP comment\en";
\& /$RE{comment}{Java}/ and print "Contains a Java comment\en";
\& /$RE{comment}{Perl}/ and print "Contains a Perl comment\en";
\& /$RE{comment}{awk}/ and print "Contains an awk comment\en";
\& /$RE{comment}{HTML}/ and print "Contains an HTML comment\en";
\& }
\&
\& use Regexp::Common qw /comment RE_comment_HTML/;
\&
\& while (<>) {
\& $_ =~ RE_comment_HTML() and print "Contains an HTML comment\en";
\& }
.Ve
.SH DESCRIPTION
.IX Header "DESCRIPTION"
Please consult the manual of Regexp::Common for a general description
of the works of this interface.
.PP
Do not use this module directly, but load it via \fIRegexp::Common\fR.
.PP
This modules gives you regular expressions for comments in various
languages.
.SS "THE LANGUAGES"
.IX Subsection "THE LANGUAGES"
Below, the comments of each of the languages are described.
The patterns are available as \f(CW\*(C`$RE{comment}{\fR\f(CILANG\fR\f(CW}\*(C'\fR, foreach
language \fILANG\fR. Some languages have variants; it's described
at the individual languages how to get the patterns for the variants.
Unless mentioned otherwise,
\&\f(CW\*(C`{\-keep}\*(C'\fR sets \f(CW$1\fR, \f(CW$2\fR, \f(CW$3\fR and \f(CW$4\fR to the entire comment,
the opening marker, the content of the comment, and the closing marker
(for many languages, the latter is a newline) respectively.
.IP ABC 4
.IX Item "ABC"
Comments in \fIABC\fR start with a backslash (\f(CW\*(C`\e\*(C'\fR), and last till
the end of the line.
See .
.IP Ada 4
.IX Item "Ada"
Comments in \fIAda\fR start with \f(CW\*(C`\-\-\*(C'\fR, and last till the end of the line.
.IP Advisor 4
.IX Item "Advisor"
\&\fIAdvisor\fR is a language used by the HP product \fIglance\fR. Comments for
this language start with either \f(CW\*(C`#\*(C'\fR or \f(CW\*(C`//\*(C'\fR, and last till the
end of the line.
.IP Advsys 4
.IX Item "Advsys"
Comments for the \fIAdvsys\fR language start with \f(CW\*(C`;\*(C'\fR and last till
the end of the line. See also .
.IP Alan 4
.IX Item "Alan"
\&\fIAlan\fR comments start with \f(CW\*(C`\-\-\*(C'\fR, and last till the end of the line.
See also .
.IP "Algol 60" 4
.IX Item "Algol 60"
Comments in the \fIAlgol 60\fR language start with the keyword \f(CW\*(C`comment\*(C'\fR,
and end with a \f(CW\*(C`;\*(C'\fR. See .
.IP "Algol 68" 4
.IX Item "Algol 68"
In \fIAlgol 68\fR, comments are either delimited by \f(CW\*(C`#\*(C'\fR, or by one of the
keywords \f(CW\*(C`co\*(C'\fR or \f(CW\*(C`comment\*(C'\fR. The keywords should not be part of another
word. See .
With \f(CW\*(C`{\-keep}\*(C'\fR, only \f(CW$1\fR will be set, returning the entire comment.
.IP ALPACA 4
.IX Item "ALPACA"
The \fIALPACA\fR language has comments starting with \f(CW\*(C`/*\*(C'\fR and ending with \f(CW\*(C`*/\*(C'\fR.
.IP awk 4
.IX Item "awk"
The \fIawk\fR programming language uses comments that start with \f(CW\*(C`#\*(C'\fR
and end at the end of the line.
.IP B 4
.IX Item "B"
The \fIB\fR language has comments starting with \f(CW\*(C`/*\*(C'\fR and ending with \f(CW\*(C`*/\*(C'\fR.
.IP BASIC 4
.IX Item "BASIC"
There are various forms of BASIC around. Currently, we only support the
variant supported by \fImvEnterprise\fR, whose pattern is available as
\&\f(CW\*(C`$RE{comment}{BASIC}{mvEnterprise}\*(C'\fR. Comments in this language start with a
\&\f(CW\*(C`!\*(C'\fR, a \f(CW\*(C`*\*(C'\fR or the keyword \f(CW\*(C`REM\*(C'\fR, and end till the end of the line. See
.
.IP Beatnik 4
.IX Item "Beatnik"
The esotoric language \fIBeatnik\fR only uses words consisting of letters.
Words are scored according to the rules of Scrabble. Words scoring less
than 5 points, or 18 points or more are considered comments (although
the compiler might mock at you if you score less than 5 points).
Regardless whether \f(CW\*(C`{\-keep}\*(C'\fR, \f(CW$1\fR will be set, and set to the
entire comment. This pattern requires \fIperl 5.8.0\fR or newer.
.IP beta-Juliet 4
.IX Item "beta-Juliet"
The \fIbeta-Juliet\fR programming language has comments that start with
\&\f(CW\*(C`//\*(C'\fR and that continue till the end of the line. See also
.
.IP Befunge\-98 4
.IX Item "Befunge-98"
The esotoric language \fIBefunge\-98\fR uses comments that start and end
with a \f(CW\*(C`;\*(C'\fR. See .
.IP BML 4
.IX Item "BML"
\&\fIBML\fR, or \fIBetter Markup Language\fR is an HTML templating language that
uses comments starting with \f(CW\*(C`\*(C'\fR.
See .
.IP Brainfuck 4
.IX Item "Brainfuck"
The minimal language \fIBrainfuck\fR uses only eight characters,
\&\f(CW\*(C`<\*(C'\fR, \f(CW\*(C`>\*(C'\fR, \f(CW\*(C`[\*(C'\fR, \f(CW\*(C`]\*(C'\fR, \f(CW\*(C`+\*(C'\fR, \f(CW\*(C`\-\*(C'\fR, \f(CW\*(C`.\*(C'\fR and \f(CW\*(C`,\*(C'\fR.
Any other characters are considered comments. With \f(CW\*(C`{\-keep}\*(C'\fR,
\&\f(CW$1\fR is set to the entire comment.
.IP C 4
.IX Item "C"
The \fIC\fR language has comments starting with \f(CW\*(C`/*\*(C'\fR and ending with \f(CW\*(C`*/\*(C'\fR.
.IP C\-\- 4
.IX Item "C--"
The \fIC\-\-\fR language has comments starting with \f(CW\*(C`/*\*(C'\fR and ending with \f(CW\*(C`*/\*(C'\fR.
See .
.IP C++ 4
.IX Item "C++"
The \fIC++\fR language has two forms of comments. Comments that start with
\&\f(CW\*(C`//\*(C'\fR and last till the end of the line, and comments that start with
\&\f(CW\*(C`/*\*(C'\fR, and end with \f(CW\*(C`*/\*(C'\fR. If \f(CW\*(C`{\-keep}\*(C'\fR is used, only \f(CW$1\fR will be
set, and set to the entire comment.
.IP C# 4
.IX Item "C#"
The \fIC#\fR language has two forms of comments. Comments that start with
\&\f(CW\*(C`//\*(C'\fR and last till the end of the line, and comments that start with
\&\f(CW\*(C`/*\*(C'\fR, and end with \f(CW\*(C`*/\*(C'\fR. If \f(CW\*(C`{\-keep}\*(C'\fR is used, only \f(CW$1\fR will be
set, and set to the entire comment.
See .
.IP Caml 4
.IX Item "Caml"
Comments in \fICaml\fR start with \f(CW\*(C`(*\*(C'\fR, end with \f(CW\*(C`*)\*(C'\fR, and can be nested.
See and
.
.IP Cg 4
.IX Item "Cg"
The \fICg\fR language has two forms of comments. Comments that start with
\&\f(CW\*(C`//\*(C'\fR and last till the end of the line, and comments that start with
\&\f(CW\*(C`/*\*(C'\fR, and end with \f(CW\*(C`*/\*(C'\fR. If \f(CW\*(C`{\-keep}\*(C'\fR is used, only \f(CW$1\fR will be
set, and set to the entire comment.
See .
.IP CLU 4
.IX Item "CLU"
In \f(CW\*(C`CLU\*(C'\fR, a comment starts with a procent sign (\f(CW\*(C`%\*(C'\fR), and ends with the
next newline. See and
.
.IP COBOL 4
.IX Item "COBOL"
Traditionally, comments in \fICOBOL\fR are indicated by an asteriks in the
seventh column. This is what the pattern matches. Modern compiler may
more lenient though. See ,
and .
.IP CQL 4
.IX Item "CQL"
Comments in the chess query language (\fICQL\fR) start with a semi colon
(\f(CW\*(C`;\*(C'\fR) and last till the end of the line. See .
.IP "Crystal Report" 4
.IX Item "Crystal Report"
The formula editor in \fICrystal Reports\fR uses comments that start
with \f(CW\*(C`//\*(C'\fR, and end with the end of the line.
.IP Dylan 4
.IX Item "Dylan"
There are two types of comments in \fIDylan\fR. They either start with
\&\f(CW\*(C`//\*(C'\fR, or are nested comments, delimited with \f(CW\*(C`/*\*(C'\fR and \f(CW\*(C`*/\*(C'\fR.
Under \f(CW\*(C`{\-keep}\*(C'\fR, only \f(CW$1\fR will be set, returning the entire comment.
This pattern requires \fIperl 5.6.0\fR or newer.
.IP ECMAScript 4
.IX Item "ECMAScript"
The \fIECMAScript\fR language has two forms of comments. Comments that start with
\&\f(CW\*(C`//\*(C'\fR and last till the end of the line, and comments that start with
\&\f(CW\*(C`/*\*(C'\fR, and end with \f(CW\*(C`*/\*(C'\fR. If \f(CW\*(C`{\-keep}\*(C'\fR is used, only \f(CW$1\fR will be
set, and set to the entire comment. \fIJavaScript\fR is Netscapes implementation
of \fIECMAScript\fR. See
,
and .
.IP Eiffel 4
.IX Item "Eiffel"
\&\fIEiffel\fR comments start with \f(CW\*(C`\-\-\*(C'\fR, and last till the end of the line.
.IP False 4
.IX Item "False"
In \fIFalse\fR, comments start with \f(CW\*(C`{\*(C'\fR and end with \f(CW\*(C`}\*(C'\fR.
See
.IP FPL 4
.IX Item "FPL"
The \fIFPL\fR language has two forms of comments. Comments that start with
\&\f(CW\*(C`//\*(C'\fR and last till the end of the line, and comments that start with
\&\f(CW\*(C`/*\*(C'\fR, and end with \f(CW\*(C`*/\*(C'\fR. If \f(CW\*(C`{\-keep}\*(C'\fR is used, only \f(CW$1\fR will be
set, and set to the entire comment.
.IP Forth 4
.IX Item "Forth"
Comments in Forth start with \f(CW\*(C`\e\*(C'\fR, and end with the end of the line.
See also .
.IP Fortran 4
.IX Item "Fortran"
There are two forms of \fIFortran\fR. There's free form \fIFortran\fR, which
has comments that start with \f(CW\*(C`!\*(C'\fR, and end at the end of the line.
The pattern for this is given by \f(CW$RE{Fortran}\fR. Fixed form \fIFortran\fR,
which has been obsoleted, has comments that start with \f(CW\*(C`C\*(C'\fR, \f(CW\*(C`c\*(C'\fR or
\&\f(CW\*(C`*\*(C'\fR in the first column, or with \f(CW\*(C`!\*(C'\fR anywhere, but the sixth column.
The pattern for this are given by \f(CW\*(C`$RE{Fortran}{fixed}\*(C'\fR.
.Sp
See also .
.IP Funge\-98 4
.IX Item "Funge-98"
The esotoric language \fIFunge\-98\fR uses comments that start and end with
a \f(CW\*(C`;\*(C'\fR.
.IP fvwm2 4
.IX Item "fvwm2"
Configuration files for \fIfvwm2\fR have comments starting with a
\&\f(CW\*(C`#\*(C'\fR and lasting the rest of the line.
.IP Haifu 4
.IX Item "Haifu"
\&\fIHaifu\fR, an esotoric language using haikus, has comments starting and
ending with a \f(CW\*(C`,\*(C'\fR.
See .
.IP Haskell 4
.IX Item "Haskell"
There are two types of comments in \fIHaskell\fR. They either start with
at least two dashes, or are nested comments, delimited with \f(CW\*(C`{\-\*(C'\fR and \f(CW\*(C`\-}\*(C'\fR.
Under \f(CW\*(C`{\-keep}\*(C'\fR, only \f(CW$1\fR will be set, returning the entire comment.
This pattern requires \fIperl 5.6.0\fR or newer.
.IP HTML 4
.IX Item "HTML"
In \fIHTML\fR, comments only appear inside a \fIcomment declaration\fR.
A comment declaration starts with a \f(CW\*(C`\*(C'\fR. Inside this declaration, we have zero or more comments.
Comments starts with \f(CW\*(C`\-\-\*(C'\fR and end with \f(CW\*(C`\-\-\*(C'\fR, and are optionally
followed by whitespace. The pattern \f(CW\*(C`$RE{comment}{HTML}\*(C'\fR recognizes
those comment declarations (and hence more than a comment).
Note that this is not the same as something that starts with
\&\f(CW\*(C`\*(C'\fR, because the following will
be matched completely:
.Sp
.Vb 3
\& Second Comment
.Ve
.Sp
Do not be fooled by what your favourite browser thinks is an HTML
comment.
.Sp
If \f(CW\*(C`{\-keep}\*(C'\fR is used, the following are returned:
.RS 4
.ie n .IP $1 4
.el .IP \f(CW$1\fR 4
.IX Item "$1"
captures the entire comment declaration.
.ie n .IP $2 4
.el .IP \f(CW$2\fR 4
.IX Item "$2"
captures the MDO (markup declaration open), \f(CW\*(C`\*(C'\fR.
.RE
.RS 4
.RE
.IP Hugo 4
.IX Item "Hugo"
There are two types of comments in \fIHugo\fR. They either start with
\&\f(CW\*(C`!\*(C'\fR (which cannot be followed by a \f(CW\*(C`\e\*(C'\fR), or are nested comments,
delimited with \f(CW\*(C`!\e\*(C'\fR and \f(CW\*(C`\e!\*(C'\fR.
Under \f(CW\*(C`{\-keep}\*(C'\fR, only \f(CW$1\fR will be set, returning the entire comment.
This pattern requires \fIperl 5.6.0\fR or newer.
.IP Icon 4
.IX Item "Icon"
\&\fIIcon\fR has comments that start with \f(CW\*(C`#\*(C'\fR and end at the next new line.
See ,
, and
.
.IP ILLGOL 4
.IX Item "ILLGOL"
The esotoric language \fIILLGOL\fR uses comments starting with \fINB\fR and lasting
till the end of the line.
See .
.IP INTERCAL 4
.IX Item "INTERCAL"
Comments in INTERCAL are single line comments. They start with one of
the keywords \f(CW\*(C`NOT\*(C'\fR or \f(CW\*(C`N\*(AqT\*(C'\fR, and can optionally be preceded by the
keywords \f(CW\*(C`DO\*(C'\fR and \f(CW\*(C`PLEASE\*(C'\fR. If both keywords are used, \f(CW\*(C`PLEASE\*(C'\fR
precedes \f(CW\*(C`DO\*(C'\fR. Keywords are separated by whitespace.
.IP J 4
.IX Item "J"
The language \fIJ\fR uses comments that start with \f(CW\*(C`NB.\*(C'\fR, and that last till
the end of the line. See
, and
.
.IP Java 4
.IX Item "Java"
The \fIJava\fR language has two forms of comments. Comments that start with
\&\f(CW\*(C`//\*(C'\fR and last till the end of the line, and comments that start with
\&\f(CW\*(C`/*\*(C'\fR, and end with \f(CW\*(C`*/\*(C'\fR. If \f(CW\*(C`{\-keep}\*(C'\fR is used, only \f(CW$1\fR will be
set, and set to the entire comment.
.IP JavaDoc 4
.IX Item "JavaDoc"
The \fIJavadoc\fR documentation syntax is demarked with a subset of
ordinary Java comments to separate it from code. Comments start with
\&\f(CW\*(C`/**\*(C'\fR end with \f(CW\*(C`*/\*(C'\fR. If \f(CW\*(C`{\-keep}\*(C'\fR is used, only \f(CW$1\fR will be set,
and set to the entire comment. See
.
.IP JavaScript 4
.IX Item "JavaScript"
The \fIJavaScript\fR language has two forms of comments. Comments that start with
\&\f(CW\*(C`//\*(C'\fR and last till the end of the line, and comments that start with
\&\f(CW\*(C`/*\*(C'\fR, and end with \f(CW\*(C`*/\*(C'\fR. If \f(CW\*(C`{\-keep}\*(C'\fR is used, only \f(CW$1\fR will be
set, and set to the entire comment. \fIJavaScript\fR is Netscapes implementation
of \fIECMAScript\fR.
See ,
and .
.IP LaTeX 4
.IX Item "LaTeX"
The documentation language \fILaTeX\fR uses comments starting with \f(CW\*(C`%\*(C'\fR
and ending at the end of the line.
.IP Lisp 4
.IX Item "Lisp"
Comments in \fILisp\fR start with a semi-colon (\f(CW\*(C`;\*(C'\fR) and last till the
end of the line.
.IP LPC 4
.IX Item "LPC"
The \fILPC\fR language has comments starting with \f(CW\*(C`/*\*(C'\fR and ending with \f(CW\*(C`*/\*(C'\fR.
.IP LOGO 4
.IX Item "LOGO"
Comments for the language \fILOGO\fR start with \f(CW\*(C`;\*(C'\fR, and last till the end
of the line.
.IP lua 4
.IX Item "lua"
Comments for the \fIlua\fR language start with \f(CW\*(C`\-\-\*(C'\fR, and last till the end
of the line. See also .
.IP "M, MUMPS" 4
.IX Item "M, MUMPS"
In \f(CW\*(C`M\*(C'\fR (aka \f(CW\*(C`MUMPS\*(C'\fR), comments start with a semi-colon, and last
till the end of a line. The language specification requires the
semi-colon to be preceded by one or more \fIlinestart character\fRs.
Those characters default to a space, but that's configurable. This
requirement, of preceding the comment with linestart characters is
\&\fBnot\fR tested for. See
,
, and
.
.IP m4 4
.IX Item "m4"
By default, the preprocessor language \fIm4\fR uses single line comments,
that start with a \f(CW\*(C`#\*(C'\fR and continue to the end of the line, including
the newline. The pattern \f(CW\*(C`$RE {comment} {m4}\*(C'\fR matches such comments.
In \fIm4\fR, it is possible to change the starting token though.
See ,
, and
.
.IP Modula\-2 4
.IX Item "Modula-2"
In \f(CW\*(C`Modula\-2\*(C'\fR, comments start with \f(CW\*(C`(*\*(C'\fR, and end with \f(CW\*(C`*)\*(C'\fR. Comments
may be nested. See .
.IP Modula\-3 4
.IX Item "Modula-3"
In \f(CW\*(C`Modula\-3\*(C'\fR, comments start with \f(CW\*(C`(*\*(C'\fR, and end with \f(CW\*(C`*)\*(C'\fR. Comments
may be nested. See .
.IP mutt 4
.IX Item "mutt"
Configuration files for \fImutt\fR have comments starting with a
\&\f(CW\*(C`#\*(C'\fR and lasting the rest of the line.
.IP Nickle 4
.IX Item "Nickle"
The \fINickle\fR language has one line comments starting with \f(CW\*(C`#\*(C'\fR
(like Perl), or multiline comments delimited by \f(CW\*(C`/*\*(C'\fR and \f(CW\*(C`*/\*(C'\fR
(like C). Under \f(CW\*(C`\-keep\*(C'\fR, only \f(CW$1\fR will be set. See also
.
.IP Oberon 4
.IX Item "Oberon"
Comments in \fIOberon\fR start with \f(CW\*(C`(*\*(C'\fR and end with \f(CW\*(C`*)\*(C'\fR.
See .
.IP Pascal 4
.IX Item "Pascal"
There are many implementations of Pascal. This modules provides
pattern for comments of several implementations.
.RS 4
.ie n .IP """$RE{comment}{Pascal}""" 4
.el .IP \f(CW$RE{comment}{Pascal}\fR 4
.IX Item "$RE{comment}{Pascal}"
This is the pattern that recognizes comments according to the Pascal ISO
standard. This standard says that comments start with either \f(CW\*(C`{\*(C'\fR, or
\&\f(CW\*(C`(*\*(C'\fR, and end with \f(CW\*(C`}\*(C'\fR or \f(CW\*(C`*)\*(C'\fR. This means that \f(CW\*(C`{*)\*(C'\fR and \f(CW\*(C`(*}\*(C'\fR
are considered to be comments. Many Pascal applications don't allow this.
See
.ie n .IP """$RE{comment}{Pascal}{Alice}""" 4
.el .IP \f(CW$RE{comment}{Pascal}{Alice}\fR 4
.IX Item "$RE{comment}{Pascal}{Alice}"
The \fIAlice Pascal\fR compiler accepts comments that start with \f(CW\*(C`{\*(C'\fR
and end with \f(CW\*(C`}\*(C'\fR. Comments are not allowed to contain newlines.
See .
.ie n .IP """$RE{comment}{Pascal}{Delphi}"", ""$RE{comment}{Pascal}{Free}"" and ""$RE{comment}{Pascal}{GPC}""" 4
.el .IP "\f(CW$RE{comment}{Pascal}{Delphi}\fR, \f(CW$RE{comment}{Pascal}{Free}\fR and \f(CW$RE{comment}{Pascal}{GPC}\fR" 4
.IX Item "$RE{comment}{Pascal}{Delphi}, $RE{comment}{Pascal}{Free} and $RE{comment}{Pascal}{GPC}"
The \fIDelphi Pascal\fR, \fIFree Pascal\fR and the \fIGnu Pascal Compiler\fR
implementations of Pascal all have comments that either start with
\&\f(CW\*(C`//\*(C'\fR and last till the end of the line, are delimited with \f(CW\*(C`{\*(C'\fR
and \f(CW\*(C`}\*(C'\fR or are delimited with \f(CW\*(C`(*\*(C'\fR and \f(CW\*(C`*)\*(C'\fR. Patterns for those
comments are given by \f(CW\*(C`$RE{comment}{Pascal}{Delphi}\*(C'\fR,
\&\f(CW\*(C`$RE{comment}{Pascal}{Free}\*(C'\fR and \f(CW\*(C`$RE{comment}{Pascal}{GPC}\*(C'\fR
respectively. These patterns only set \f(CW$1\fR when \f(CW\*(C`{\-keep}\*(C'\fR is used,
which will then include the entire comment.
.Sp
See ,
and
.
.ie n .IP """$RE{comment}{Pascal}{Workshop}""" 4
.el .IP \f(CW$RE{comment}{Pascal}{Workshop}\fR 4
.IX Item "$RE{comment}{Pascal}{Workshop}"
The \fIWorkshop Pascal\fR compiler, from SUN Microsystems, allows comments
that are delimited with either \f(CW\*(C`{\*(C'\fR and \f(CW\*(C`}\*(C'\fR, delimited with
\&\f(CW\*(C`(*)\*(C'\fR and \f(CW\*(C`*\*(C'\fR), delimited with \f(CW\*(C`/*\*(C'\fR, and \f(CW\*(C`*/\*(C'\fR, or starting
and ending with a double quote (\f(CW\*(C`"\*(C'\fR). When \f(CW\*(C`{\-keep}\*(C'\fR is used,
only \f(CW$1\fR is set, and returns the entire comment.
.Sp
See .
.RE
.RS 4
.RE
.IP PEARL 4
.IX Item "PEARL"
Comments in \fIPEARL\fR start with a \f(CW\*(C`!\*(C'\fR and last till the end of the
line, or start with \f(CW\*(C`/*\*(C'\fR and end with \f(CW\*(C`*/\*(C'\fR. With \f(CW\*(C`{\-keep}\*(C'\fR,
\&\f(CW$1\fR will be set to the entire comment.
.IP PHP 4
.IX Item "PHP"
Comments in \fIPHP\fR start with either \f(CW\*(C`#\*(C'\fR or \f(CW\*(C`//\*(C'\fR and last till the
end of the line, or are delimited by \f(CW\*(C`/*\*(C'\fR and \f(CW\*(C`*/\*(C'\fR. With \f(CW\*(C`{\-keep}\*(C'\fR,
\&\f(CW$1\fR will be set to the entire comment.
.IP PL/B 4
.IX Item "PL/B"
In \fIPL/B\fR, comments start with either \f(CW\*(C`.\*(C'\fR or \f(CW\*(C`;\*(C'\fR, and end with the
next newline. See .
.IP PL/I 4
.IX Item "PL/I"
The \fIPL/I\fR language has comments starting with \f(CW\*(C`/*\*(C'\fR and ending with \f(CW\*(C`*/\*(C'\fR.
.IP PL/SQL 4
.IX Item "PL/SQL"
In \fIPL/SQL\fR, comments either start with \f(CW\*(C`\-\-\*(C'\fR and run till the end
of the line, or start with \f(CW\*(C`/*\*(C'\fR and end with \f(CW\*(C`*/\*(C'\fR.
.IP Perl 4
.IX Item "Perl"
\&\fIPerl\fR uses comments that start with a \f(CW\*(C`#\*(C'\fR, and continue till the end
of the line.
.IP Portia 4
.IX Item "Portia"
The \fIPortia\fR programming language has comments that start with \f(CW\*(C`//\*(C'\fR,
and last till the end of the line.
.IP Python 4
.IX Item "Python"
\&\fIPython\fR uses comments that start with a \f(CW\*(C`#\*(C'\fR, and continue till the end
of the line.
.IP Q\-BAL 4
.IX Item "Q-BAL"
Comments in the \fIQ\-BAL\fR language start with \f(CW\*(C`\`\*(C'\fR (a backtick), and
contine till the end of the line.
.IP QML 4
.IX Item "QML"
In \f(CW\*(C`QML\*(C'\fR, comments start with \f(CW\*(C`#\*(C'\fR and last till the end of the line.
See .
.IP R 4
.IX Item "R"
The statistical language \fIR\fR uses comments that start with a \f(CW\*(C`#\*(C'\fR and
end with the following new line. See .
.IP REBOL 4
.IX Item "REBOL"
Comments for the \fIREBOL\fR language start with \f(CW\*(C`;\*(C'\fR and last till the
end of the line.
.IP Ruby 4
.IX Item "Ruby"
Comments in \fIRuby\fR start with \f(CW\*(C`#\*(C'\fR and last till the end of the time.
.IP Scheme 4
.IX Item "Scheme"
\&\fIScheme\fR comments start with \f(CW\*(C`;\*(C'\fR, and last till the end of the line.
See .
.IP shell 4
.IX Item "shell"
Comments in various \fIshell\fRs start with a \f(CW\*(C`#\*(C'\fR and end at the end of
the line.
.IP Shelta 4
.IX Item "Shelta"
The esotoric language \fIShelta\fR uses comments that start and end with
a \f(CW\*(C`;\*(C'\fR. See .
.IP SLIDE 4
.IX Item "SLIDE"
The \fISLIDE\fR language has two froms of comments. First there is the
line comment, which starts with a \f(CW\*(C`#\*(C'\fR and includes the rest of the
line (just like Perl). Second, there is the multiline, nested comment,
which are delimited by \f(CW\*(C`(*\*(C'\fR and \f(CW\*(C`*)\*(C'\fR. Under C{\-keep}>, only
\&\f(CW$1\fR is set, and is set to the entire comment. See
.
.IP slrn 4
.IX Item "slrn"
Configuration files for \fIslrn\fR have comments starting with a
\&\f(CW\*(C`%\*(C'\fR and lasting the rest of the line.
.IP Smalltalk 4
.IX Item "Smalltalk"
\&\fISmalltalk\fR uses comments that start and end with a double quote, \f(CW\*(C`"\*(C'\fR.
.IP SMITH 4
.IX Item "SMITH"
Comments in the \fISMITH\fR language start with \f(CW\*(C`;\*(C'\fR, and last till the
end of the line.
.IP Squeak 4
.IX Item "Squeak"
In the Smalltalk variant \fISqueak\fR, comments start and end with
\&\f(CW\*(C`"\*(C'\fR. Double quotes can appear inside comments by doubling them.
.IP SQL 4
.IX Item "SQL"
Standard \fISQL\fR uses comments starting with two or more dashes, and
ending at the end of the line.
.Sp
\&\fIMySQL\fR does not follow the standard. Instead, it allows comments
that start with a \f(CW\*(C`#\*(C'\fR or \f(CW\*(C`\-\- \*(C'\fR (that's two dashes and a space)
ending with the following newline, and comments starting with
\&\f(CW\*(C`/*\*(C'\fR, and ending with the next \f(CW\*(C`;\*(C'\fR or \f(CW\*(C`*/\*(C'\fR that isn't inside
single or double quotes. A pattern for this is returned by
\&\f(CW\*(C`$RE{comment}{SQL}{MySQL}\*(C'\fR. With \f(CW\*(C`{\-keep}\*(C'\fR, only \f(CW$1\fR will
be set, and it returns the entire comment.
.IP Tcl 4
.IX Item "Tcl"
In \fITcl\fR, comments start with \f(CW\*(C`#\*(C'\fR and continue till the end of the line.
.IP TeX 4
.IX Item "TeX"
The documentation language \fITeX\fR uses comments starting with \f(CW\*(C`%\*(C'\fR
and ending at the end of the line.
.IP troff 4
.IX Item "troff"
The document formatting language \fItroff\fR uses comments starting
with \f(CW\*(C`\e"\*(C'\fR, and continuing till the end of the line.
.IP Ubercode 4
.IX Item "Ubercode"
The Windows programming language \fIUbercode\fR uses comments that start with
\&\f(CW\*(C`//\*(C'\fR and continue to the end of the line. See .
.IP vi 4
.IX Item "vi"
In configuration files for the editor \fIvi\fR, one can use comments
starting with \f(CW\*(C`"\*(C'\fR, and ending at the end of the line.
.IP *W 4
.IX Item "*W"
In the language \fI*W\fR, comments start with \f(CW\*(C`||\*(C'\fR, and end with \f(CW\*(C`!!\*(C'\fR.
.IP zonefile 4
.IX Item "zonefile"
Comments in DNS \fIzonefile\fRs start with \f(CW\*(C`;\*(C'\fR, and continue till the
end of the line.
.IP ZZT-OOP 4
.IX Item "ZZT-OOP"
The in-game language \fIZZT-OOP\fR uses comments that start with a \f(CW\*(C`\*(Aq\*(C'\fR
character, and end at the following newline. See
.
.SH REFERENCES
.IX Header "REFERENCES"
.IP "\fB[Go 90]\fR" 4
.IX Item "[Go 90]"
Charles F. Goldfarb: \fIThe SGML Handbook\fR. Oxford: Oxford University
Press. \fB1990\fR. ISBN 0\-19\-853737\-9. Ch. 10.3, pp 390\-391.
.SH "SEE ALSO"
.IX Header "SEE ALSO"
Regexp::Common for a general description of how to use this interface.
.SH AUTHOR
.IX Header "AUTHOR"
Damian Conway (damian@conway.org)
.SH MAINTENANCE
.IX Header "MAINTENANCE"
This package is maintained by Abigail (\fIregexp\-common@abigail.be\fR).
.SH "BUGS AND IRRITATIONS"
.IX Header "BUGS AND IRRITATIONS"
Bound to be plenty.
.PP
For a start, there are many common regexes missing.
Send them in to \fIregexp\-common@abigail.be\fR.
.SH "LICENSE and COPYRIGHT"
.IX Header "LICENSE and COPYRIGHT"
This software is Copyright (c) 2001 \- 2017, Damian Conway and Abigail.
.PP
This module is free software, and maybe used under any of the following
licenses:
.PP
.Vb 4
\& 1) The Perl Artistic License. See the file COPYRIGHT.AL.
\& 2) The Perl Artistic License 2.0. See the file COPYRIGHT.AL2.
\& 3) The BSD License. See the file COPYRIGHT.BSD.
\& 4) The MIT License. See the file COPYRIGHT.MIT.
.Ve