aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--youtube/yt_data_extract/common.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/youtube/yt_data_extract/common.py b/youtube/yt_data_extract/common.py
index 06f0e95..4af76c2 100644
--- a/youtube/yt_data_extract/common.py
+++ b/youtube/yt_data_extract/common.py
@@ -135,7 +135,7 @@ def extract_int(string, default=None):
string = extract_str(string)
if not string:
return default
- match = re.search(r'(\d+)', string.replace(',', ''))
+ match = re.search(r'\b(\d+)\b', string.replace(',', ''))
if match is None:
return default
try:
@@ -149,7 +149,7 @@ def extract_approx_int(string):
string = extract_str(string)
if not string:
return None
- match = re.search(r'(\d+(?:\.\d+)?[KMBTkmbt])', string.replace(',', ''))
+ match = re.search(r'\b(\d+(?:\.\d+)?[KMBTkmbt]?)\b', string.replace(',', ''))
if match is None:
return None
return match.group(1)