+ return match_glob($page, $glob, @_);
+}
+
+sub match_comment ($$;@) {
+ my $page = shift;
+ my $glob = shift;
+
+ my $match=match_glob($page, "$glob/*", @_);
+ if ($match) {
+ my $type=IkiWiki::pagetype($IkiWiki::pagesources{$page});
+ if ($type ne "_comment") {
+ return IkiWiki::FailReason->new("$page is not a comment");
+ }
+ }
+ return $match;
+}
+
+sub match_comment_pending ($$;@) {
+ my $page = shift;
+ my $glob = shift;
+
+ my $match=match_glob($page, "$glob/*", @_);
+ if ($match) {
+ my $type=IkiWiki::pagetype($IkiWiki::pagesources{$page});
+ if ($type ne "_comment_pending") {
+ return IkiWiki::FailReason->new("$page is not a pending comment");
+ }
+ }
+ return $match;