.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) .\" .\" 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 .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' '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 turned on, 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. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Regexp::Common::comment 3pm" .TH Regexp::Common::comment 3pm "2011-04-18" "perl v5.14.2" "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 "\s-1THE\s0 \s-1LANGUAGES\s0" .IX Subsection "THE LANGUAGES" Below, the comments of each of the languages are described. The patterns are available as \f(CW$RE{comment}{\f(CILANG\f(CW}\fR, foreach language \fI\s-1LANG\s0\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 "\s-1ABC\s0" 4 .IX Item "ABC" Comments in \fI\s-1ABC\s0\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 \s-1HP\s0 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 http://westein.arb\-phys.uni\-dortmund.de/~wb/a68s.txt . With \f(CW\*(C`{\-keep}\*(C'\fR, only \f(CW$1\fR will be set, returning the entire comment. .IP "\s-1ALPACA\s0" 4 .IX Item "ALPACA" The \fI\s-1ALPACA\s0\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 "\s-1BASIC\s0" 4 .IX Item "BASIC" There are various forms of \s-1BASIC\s0 around. Currently, we only support the variant supported by \fImvEnterprise\fR, whose pattern is available as \&\f(CW$RE{comment}{BASIC}{mvEnterprise}\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 http://www.catseye.mb.ca/esoteric/b\-juliet/index.html . .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 "\s-1BML\s0" 4 .IX Item "BML" \&\fI\s-1BML\s0\fR, or \fIBetter Markup Language\fR is an \s-1HTML\s0 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 http://cs.uas.arizona.edu/classes/453/programs/C\*(--Spec.html . .IP "\*(C+" 4 .IX Item "" The \fI\*(C+\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 http://msdn.microsoft.com/library/default.asp?url=/library/en\-us/csspec/html/vclrfcsharpspec_C.asp . .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 http://pauillac.inria.fr/caml/index\-eng.html . .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 "\s-1CLU\s0" 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 ftp://ftp.lcs.mit.edu:/pub/pclu/CLU\-syntax.ps and . .IP "\s-1COBOL\s0" 4 .IX Item "COBOL" Traditionally, comments in \fI\s-1COBOL\s0\fR are indicated by an asteriks in the seventh column. This is what the pattern matches. Modern compiler may more lenient though. See , and . Due to a bug in the regexp engine of perl 5.6.x, this regexp is only available in version 5.8.0 and up. .IP "\s-1CQL\s0" 4 .IX Item "CQL" Comments in the chess query language (\fI\s-1CQL\s0\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 http://www.ecma\-international.org/publications/files/ecma\-st/Ecma\-262.pdf , and http://www.ecma\-international.org/publications/standards/Ecma\-262.htm . .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 "\s-1FPL\s0" 4 .IX Item "FPL" The \fI\s-1FPL\s0\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 http://docs.sun.com/sb/doc/806\-1377\-10 . .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$RE{Fortran}{fixed}\fR. .Sp See also http://www.cray.com/craydoc/manuals/007\-3692\-005/html\-007\-3692\-005/ . .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 "\s-1HTML\s0" 4 .IX Item "HTML" In \fI\s-1HTML\s0\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$RE{comment}{HTML}\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 \s-1HTML\s0 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 \s-1MDO\s0 (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 "\s-1ILLGOL\s0" 4 .IX Item "ILLGOL" The esotoric language \fI\s-1ILLGOL\s0\fR uses comments starting with \fI\s-1NB\s0\fR and lasting till the end of the line. See . .IP "\s-1INTERCAL\s0" 4 .IX Item "INTERCAL" Comments in \s-1INTERCAL\s0 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 http://www.oracle.com/technetwork/java/javase/documentation/index\-137868.html#format . .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 http://www.mozilla.org/js/language/E262\-3.pdf , 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 "\s-1LPC\s0" 4 .IX Item "LPC" The \fI\s-1LPC\s0\fR language has comments starting with \f(CW\*(C`/*\*(C'\fR and ending with \f(CW\*(C`*/\*(C'\fR. .IP "\s-1LOGO\s0" 4 .IX Item "LOGO" Comments for the language \fI\s-1LOGO\s0\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, \s-1MUMPS\s0" 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 , http://www.cs.stir.ac.uk/~kjt/research/pdf/expl\-m4.pdf , 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 \s-1ISO\s0 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 http://www.pascal\-central.com/docs/iso10206.txt .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$RE{comment}{Pascal}{Delphi}\fR, \&\f(CW$RE{comment}{Pascal}{Free}\fR and \f(CW$RE{comment}{Pascal}{GPC}\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 , http://www.freepascal.org/docs\-html/ref/ref.html and http://www.gnu\-pascal.de/gpc/ . .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 \s-1SUN\s0 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 http://docs.sun.com/db/doc/802\-5762 . .RE .RS 4 .RE .IP "\s-1PEARL\s0" 4 .IX Item "PEARL" Comments in \fI\s-1PEARL\s0\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 "\s-1PHP\s0" 4 .IX Item "PHP" Comments in \fI\s-1PHP\s0\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 "\s-1PL/B\s0" 4 .IX Item "PL/B" In \fI\s-1PL/B\s0\fR, comments start with either \f(CW\*(C`.\*(C'\fR or \f(CW\*(C`;\*(C'\fR, and end with the next newline. See http://www.mmcctech.com/pl\-b/plb\-0010.htm . .IP "\s-1PL/I\s0" 4 .IX Item "PL/I" The \fI\s-1PL/I\s0\fR language has comments starting with \f(CW\*(C`/*\*(C'\fR and ending with \f(CW\*(C`*/\*(C'\fR. .IP "\s-1PL/SQL\s0" 4 .IX Item "PL/SQL" In \fI\s-1PL/SQL\s0\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 "\s-1QML\s0" 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 http://www.r\-project.org/ . .IP "\s-1REBOL\s0" 4 .IX Item "REBOL" Comments for the \fI\s-1REBOL\s0\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 "\s-1SLIDE\s0" 4 .IX Item "SLIDE" The \fI\s-1SLIDE\s0\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. This pattern needs at least Perl version 5.6.0. 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 "\s-1SMITH\s0" 4 .IX Item "SMITH" Comments in the \fI\s-1SMITH\s0\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 "\s-1SQL\s0" 4 .IX Item "SQL" Standard \fI\s-1SQL\s0\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$RE{comment}{SQL}{MySQL}\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 \s-1DNS\s0 \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 \s-1SGML\s0 Handbook\fR. Oxford: Oxford University Press. \fB1990\fR. \s-1ISBN\s0 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 "MAINTAINANCE" .IX Header "MAINTAINANCE" 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 \- 2009, 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 Licence. See the file COPYRIGHT.BSD. \& 4) The MIT Licence. See the file COPYRIGHT.MIT. .Ve