Skip to content

Commit 5decaf3

Browse files
committed
chg: Attempt to improve regex more
1 parent cc9527c commit 5decaf3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

har2tree/helper.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ def find_identifiers(html_doc: bytes) -> dict[str, list[str]] | None:
280280
# This is beta and kinda fragile, but it's going to find (most) of the google tag IDs
281281
# https://support.google.com/google-ads/answer/12326985?hl=en_us_us
282282
# NOTE: the doc says 9 X, but all the examples I found have 10 X so we cannot trust it
283-
if google_tag_ids := set(re.findall(rb"(?:G-|AW-|GA-|UA-)\w{9}+", html_doc)):
283+
if google_tag_ids := set(re.findall(rb"(?:G-|AW-|GA-|UA-)\w{9,13}", html_doc)):
284284
blocklist = {b'UA-Compatible'}
285285
google_tag_ids -= blocklist
286286
to_return['google_tag_ids'] = list(google_tag_ids)

0 commit comments

Comments
 (0)