From b98b683cc21539f93dbfa253b3d47fc054c62a45 Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Mon, 20 Feb 2017 18:08:38 -0800 Subject: [PATCH] Allow more sensible C Jeopardy filtering (do not treat underscores as word characters) --- modules/cjeopardy/cjeopardy.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/cjeopardy/cjeopardy.pl b/modules/cjeopardy/cjeopardy.pl index 1d9e7a7f..bc224bd2 100755 --- a/modules/cjeopardy/cjeopardy.pl +++ b/modules/cjeopardy/cjeopardy.pl @@ -61,16 +61,16 @@ if (defined $ret) { $filter_text =~ s/,/, /g; $filter_text =~ s/, ([^,]+)$/ or $1/; - print "[Filter active! Skipping questions containing $filter_text.]\n"; + print "[Filter active! To view or change, use the `filter` command.]\n"; my @w = split /,/, $words; my $sep = ''; $filter_regex .= '(?:'; foreach my $word (@w) { $filter_regex .= $sep; - $filter_regex .= $word =~ m/^\w/ ? '\b' : '\B'; + $filter_regex .= $word =~ m/^[a-zA-Z0-9]/ ? '\b' : '\B'; $filter_regex .= quotemeta $word; - $filter_regex .= $word =~ m/\w$/ ? '\b' : '\B'; + $filter_regex .= $word =~ m/[a-zA-Z0-9]$/ ? '\b' : '\B'; $sep = '|'; } $filter_regex .= ')';