Skip to content

Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.

Update browser_use/utils.py

Lai Yujiefcf0b9229ffe
diff --git a/browser_use/utils.py b/browser_use/utils.py
index 5cbfee760..2dec60bd7 100644
--- a/browser_use/utils.py
+++ b/browser_use/utils.py
@@ -20,7 +20,7 @@ load_dotenv()
# Pre-compiled regex for URL detection - used in URL shortening
URL_PATTERN = re.compile(r'https?://[^\s<>"\']+|www\.[^\s<>"\']+|[^\s<>"\']+\.[a-z]{2,}(?:/[^\s<>"\']*)?', re.IGNORECASE)
-URL_NEGATION_PATTERN = re.compile(r"\b(?:never|not|don'?t)\b", re.IGNORECASE)
+URL_NEGATION_PATTERN = re.compile(r"\b(?:never|not|don['\u2019]?t)\b", re.IGNORECASE)
logger = logging.getLogger(__name__)