Changeset 1192 for ValBot


Ignore:
Timestamp:
Sep 17, 2024, 1:08:26 AM (2 months ago)
Author:
iritscen
Message:

ValBot: Corrected syntax of two strings with regex patterns.

Location:
ValBot/Python
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • ValBot/Python/check_interwiki_links.py

    r1191 r1192  
    180180   for prefix in interwiki_prefixes:
    181181      # Isolate strings that start with "[[prefix:" and end with "|" or "]"
    182       iw_link = "\[\[" + prefix + ":[^|\]]*(\||\])"
     182      iw_link = r"\[\[" + prefix + r":[^|\]]*(\||\])"
    183183      for match in re.finditer(iw_link, page_text):
    184184         # Extract just the page title from this regex match
  • ValBot/Python/check_intrawiki_section_links.py

    r1188 r1192  
    3636# Pattern 1: Detect "[[anything]]", "[[any:thing]]", "[[any|thing]]", "[[any:thi|ng]]"
    3737# Pattern 2: Detect "{{SectionLink|Page|Section name}}", "{{SectionLink||Section name}}"
    38 link_patterns = ("\[\[[^|\]]*(\||\])", "\{\{SectionLink\|[^|\}]*\|[^|\}]*\}\}")
     38link_patterns = (r"\[\[[^|\]]*(\||\])", r"\{\{SectionLink\|[^|\}]*\|[^|\}]*\}\}")
    3939
    4040# Initialize globals
Note: See TracChangeset for help on using the changeset viewer.