Regexp::Common::comment is a Perl module that provide regexes for comments.
SYNOPSIS
use Regexp::Common qw /comment/;
while () {
/$RE{comment}{C}/ and print "Contains a C commentn";
/$RE{comment}{C++}/ and print "Contains a C++ commentn";
/$RE{comment}{PHP}/ and print "Contains a PHP commentn";
/$RE{comment}{Java}/ and print "Contains a Java commentn";
/$RE{comment}{Perl}/ and print "Contains a Perl commentn";
/$RE{comment}{awk}/ and print "Contains an awk commentn";
/$RE{comment}{HTML}/ and print "Contains an HTML commentn";
}
use Regexp::Common qw /comment RE_comment_HTML/;
while () {
$_ =~ RE_comment_HTML() and print "Contains an HTML commentn";
}
Please consult the manual of Regexp::Common for a general description of the works of this interface.
Do not use this module directly, but load it via Regexp::Common.
This modules gives you regular expressions for comments in various languages.