Mô đun:Template redirect regex
Giao diện
| Mô đun Lua này được sử dụng ở khoảng 44.000 trang. Để tránh gây lỗi trên quy mô lớn, tất cả thay đổi cần được thử nghiệm ở trang con /sandbox, /testcases của mô đun, hoặc ở chỗ thử mô đun. Các thay đổi đã được thử nghiệm có thể thêm vào mô đun bằng một sửa đổi duy nhất. Xin hãy thảo luận các thay đổi tại trang thảo luận trước khi áp dụng sửa đổi. |
About
For use within other modules.
Returns a table of regular expressions, sorted by descending popularity, for a parent template and all redirects to it as of a certain date, or nil.
See also
local p = {}--returns a table of regular expressions, sorted by descending popularity, for a parent template and all redirects to it as of a certain date, or nil--regex for the 1st pipe and surrounding whitespace are purposefully omitted to give the calling modules more flexibilityfunction p.main( template ) --expand the following table as-needed, following the same format local tCanonical_templates = { ['Category redirect'] = { --the following 15 pages (6 condensed) redirect to [[Bản mẫu:Đổi hướng thể loại]], as of 2025/9: '{{%s*[Cc]ate?g?o?r?y?[ _]*[rR]edirect', --parent+505+312+243+1 transclusions '{{%s*[Cc]atr', --21 '{{%s*[Cc]at[ _]*[rR]edir', --5+3 '{{%s*[Cc]at[ _]*[rR]ed', --3+2 '{{%s*[Cc]at[ _]*[mM]ove', --1 '{{%s*[Cc]ategory[ _]*[mM]ove', --0 '{{%s*[Đđ]ổi[ _]*hướng[ _]*thể[ _]*loại', '{{%s*[Tt]hể[ _]*loại[ _]*đổi[ _]*hướng', '{{%s*[Cc]huyển[ _]*hướng[ _]*thể[ _]*loại', '{{%s*[Đđ]htl', }, ['Taxonbar'] = { --the following 6 pages (3 condensed) redirect to [[Bản mẫu:Taxonbar]], as of 2023/8: '{{%s*[Tt]axon?[ _-]?[bB]ar', --parent+50+11+2+2 transclusions '{{%s*[Tt]axon[Ii]ds', --45 '{{%s*[Tt]axon[ _]*[iI]dentifiers', --1 --detect direct calls to [[Module:Taxonbar]] '{{ *#invoke *: *[Tt]axonbar', }, ['Short description'] = { --the following 5 pages (2 condensed) redirect to [[Bản mẫu:Mô tả ngắn]], as of 2025/9: '{{%s*[Ss]hort[ _]?[dD]escription', --parent+125+6 transclusions '{{%s*[Ss]hort[ _]?[d]esc', --10+8 '{{%s*[Mm]ô[ _]*tả[ _]*ngắn', }, } return tCanonical_templates[template] or nilendreturn p