Skip to content

Commit 93194a2

Browse files
committed
simplified html regex by removing useless named groups capture
1 parent e7de507 commit 93194a2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

string_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
IP_RE = re.compile(r'^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$')
6363
WORDS_COUNT_RE = re.compile(r'\W*[^\W_]+\W*', re.IGNORECASE | re.MULTILINE | re.UNICODE)
6464
HTML_RE = re.compile(
65-
r'((?P<open><([a-z]+:)?[a-z]+[^>]*/?>)((?P<content>.*?)(?P<close></([a-z]+:)?[a-z]+>))?|<!--.*-->|<!doctype.*>)',
65+
r'((<([a-z]+:)?[a-z]+[^>]*/?>)(.*?(</([a-z]+:)?[a-z]+>))?|<!--.*-->|<!doctype.*>)',
6666
re.IGNORECASE | re.MULTILINE | re.DOTALL
6767
)
6868
HTML_TAG_ONLY_RE = re.compile(

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy