[MKDoc-modules] [PATCH] Text-Structured perl-5.8.0 bug workaround

Bruno Postle bruno at webarchitects.co.uk
Fri Jul 23 14:15:53 BST 2004


perl-5.8.0 seems to be broken when using "\p{IsUpper}" in a regular
expression, [[:upper:]] works instead:

diff -baur MKDoc-Text-Structured-0.8/lib/MKDoc/Text/Structured/Inline.pm MKDoc-Text-Structured-0.8-fixed/lib/MKDoc/Text/Structured/Inline.pm
--- MKDoc-Text-Structured-0.8/lib/MKDoc/Text/Structured/Inline.pm       Fri Jul 23 13:45:30 2004
+++ MKDoc-Text-Structured-0.8-fixed/lib/MKDoc/Text/Structured/Inline.pm Fri Jul 23 13:51:52 2004
@@ -35,8 +35,8 @@
     $Text =~ s/(?<=(?:\s|\n))(\d+)\s*x\s*(\d+)(?=(?:\s|\n|\p{isPunct}))/$1\&times;$2/g;  # x     becomes dimension
                                                                                                                          
     # abbreviations
-    while ($Text =~ s/(\p{IsUpper}\p{IsUpper}+)\s+(\(.*?\))/_make_abbr_implicit ($1, $2)/e) {}; # implicit
-    while ($Text =~ s/(\p{IsUpper}\p{IsUpper}+)(\(.*?\))/_make_abbr_explicit ($1, $2)/e)    {}; # explicit
+    while ($Text =~ s/([[:upper:]][[:upper:]]+)\s+(\(.*?\))/_make_abbr_implicit ($1, $2)/e) {}; # implicit
+    while ($Text =~ s/([[:upper:]][[:upper:]]+)(\(.*?\))/_make_abbr_explicit ($1, $2)/e)    {}; # explicit
                                                                                                                          
     _make_simplequotes();
     _make_doublequotes();


-- 
Bruno


More information about the MKDoc-modules mailing list