User:AnomieBOT/source/tasks/PERTableUpdater.pm: Difference between revisions

Content deleted Content added
AnomieBOT (talk | contribs)
Updating published sources: PERTableUpdater: * Add LST section tags around the count, per request.
AnomieBOT (talk | contribs)
Updating published sources: PERTableUpdater: * Try to escape unmatched left-braces that Perl complains about when processing blacklist.
Line 133:
 
$re=~s!(\{\{\s*ns\s*:\s*(.+?)\s*\}\})! replace_ns($api,$2) // $1 !ge;
 
# Try to escape left-braces that aren't quantifiers or parameters to escapes
my $tmp = $re;
$re=~s#(?<!\\[a-zA-Z])(?<!\\)\{(?!\d+(?:,\d*)?})#\\{#g;
$api->warn( "Escaped left-braces in regex (old): $tmp" ) if $tmp ne $re;
$api->warn( "Escaped left-braces in regex (new): $re" ) if $tmp ne $re;
 
# Validate each line, in case someone screws up the blacklist page