Skip to content

Commit ab8988e

Browse files
authored
Make the regex python 3.11 compatible
1 parent 8f1b434 commit ab8988e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

wikiextractor/extract.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -380,11 +380,11 @@ def dropSpans(spans, text):
380380
# as well as U+3000 is IDEOGRAPHIC SPACE for bug 19052
381381
EXT_LINK_URL_CLASS = r'[^][<>"\x00-\x20\x7F\s]'
382382
ExtLinkBracketedRegex = re.compile(
383-
'\[(((?i)' + '|'.join(wgUrlProtocols) + ')' + EXT_LINK_URL_CLASS + r'+)\s*([^\]\x00-\x08\x0a-\x1F]*?)\]',
383+
'(?i)\[((' + '|'.join(wgUrlProtocols) + ')' + EXT_LINK_URL_CLASS + r'+)\s*([^\]\x00-\x08\x0a-\x1F]*?)\]',
384384
re.S | re.U)
385385
EXT_IMAGE_REGEX = re.compile(
386-
r"""^(http://|https://)([^][<>"\x00-\x20\x7F\s]+)
387-
/([A-Za-z0-9_.,~%\-+&;#*?!=()@\x80-\xFF]+)\.((?i)gif|png|jpg|jpeg)$""",
386+
r"""(?i)^(http://|https://)([^][<>"\x00-\x20\x7F\s]+)
387+
/([A-Za-z0-9_.,~%\-+&;#*?!=()@\x80-\xFF]+)\.(gif|png|jpg|jpeg)$""",
388388
re.X | re.S | re.U)
389389

390390

0 commit comments

Comments
 (0)