diff options
| author | fukachan <fukachan> | 2001-10-08 23:28:27 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2001-10-08 23:28:27 +0000 |
| commit | 4f9041abbe205442f063642c88aa0f3addb95253 (patch) | |
| tree | 55b833135f0e5077175177fc9e1c6372468a6f18 /fml/lib/FML/Header | |
| parent | 29fe54a4bb07ada4a6456ae9f3f5fbe012538caa (diff) | |
| download | fml8-4f9041abbe205442f063642c88aa0f3addb95253.tar.gz fml8-4f9041abbe205442f063642c88aa0f3addb95253.tar.bz2 fml8-4f9041abbe205442f063642c88aa0f3addb95253.zip | |
more clever way to create regexp: quotemeta() firstly, and hack a few
Diffstat (limited to 'fml/lib/FML/Header')
| -rw-r--r-- | fml/lib/FML/Header/Subject.pm | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/fml/lib/FML/Header/Subject.pm b/fml/lib/FML/Header/Subject.pm index 051064e7..9d217d9a 100644 --- a/fml/lib/FML/Header/Subject.pm +++ b/fml/lib/FML/Header/Subject.pm @@ -4,7 +4,7 @@ # All rights reserved. This program is free software; you can # redistribute it and/or modify it under the same terms as Perl itself. # -# $FML: Subject.pm,v 1.18 2001/06/10 10:22:45 fukachan Exp $ +# $FML: Subject.pm,v 1.19 2001/07/31 14:19:41 fukachan Exp $ # package FML::Header::Subject; @@ -129,16 +129,19 @@ sub _regexp_compile { my ($s) = @_; + $s = quotemeta( $s ); + $s =~ s@\\\%@\%@g; $s =~ s@\%s@\\S+@g; + $s =~ s@\%d@\\d+@g; $s =~ s@\%0\d+d@\\d+@g; $s =~ s@\%\d+d@\\d+@g; $s =~ s@\%\-\d+d@\\d+@g; # quote for regexp substitute: [ something ] -> \[ something \] - $s =~ s/^(.)/quotemeta($1)/e; - $s =~ s/(.)$/quotemeta($1)/e; + # $s =~ s/^(.)/quotemeta($1)/e; + # $s =~ s/(.)$/quotemeta($1)/e; - $s; + return $s; } |
