User:YiFeiBot/wikiindex size.py: Difference between revisions

no edit summary
(major change)
No edit summary
Line 88: Line 88:
         newtext = text
         newtext = text
          
          
        size_r = re.compile(ur"""(?im)(?P<all>\{\{\s*Size\s*((\s*\|\s*(?P<pages>pages|wiki[ _]pages)\s*=\s*(?P<pages_value>\d*)\s*[^\|\}]*\s*)|(\s*\|\s*(?P<pagesurl>statistics[ _]URL|wiki[ _]statistics[ _]URL)\s*=\s*(?P<pagesurl_value>https?://[^ \|\}\<]*)\s*[^\|\}]*\s*)|(\s*\|\s*(?P<wikifactor>wikiFactor)\s*=\s*(?P<wikifactor_value>\d*)\s*[^\|\}]*\s*)|(\s*\|\s*(?P<wikifactorurl>wikiFactor[ _]URL)\s*=\s*(?P<wikifactorurl_value>http://[^ \|\}\<]*)\s*[^\|\}]*\s*))+\s*\|?\s*\}\})""")
         m = size_r.finditer(text)
         m = size_r.finditer(text)
       
        all = ""
        newvalues = ""
         for i in m:
         for i in m:
             all = i.group('all') and i.group('all').strip() or ''
             all = i.group('all') and i.group('all').strip() or ''
checkuser, Administrators
2,635

edits