- Timestamp:
- Sep 17, 2024, 1:08:26 AM (2 months ago)
- Location:
- ValBot/Python
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
ValBot/Python/check_interwiki_links.py
r1191 r1192 180 180 for prefix in interwiki_prefixes: 181 181 # Isolate strings that start with "[[prefix:" and end with "|" or "]" 182 iw_link = "\[\[" + prefix +":[^|\]]*(\||\])"182 iw_link = r"\[\[" + prefix + r":[^|\]]*(\||\])" 183 183 for match in re.finditer(iw_link, page_text): 184 184 # Extract just the page title from this regex match -
ValBot/Python/check_intrawiki_section_links.py
r1188 r1192 36 36 # Pattern 1: Detect "[[anything]]", "[[any:thing]]", "[[any|thing]]", "[[any:thi|ng]]" 37 37 # Pattern 2: Detect "{{SectionLink|Page|Section name}}", "{{SectionLink||Section name}}" 38 link_patterns = ( "\[\[[^|\]]*(\||\])","\{\{SectionLink\|[^|\}]*\|[^|\}]*\}\}")38 link_patterns = (r"\[\[[^|\]]*(\||\])", r"\{\{SectionLink\|[^|\}]*\|[^|\}]*\}\}") 39 39 40 40 # Initialize globals
Note:
See TracChangeset
for help on using the changeset viewer.