diff --git a/eng/versioning/utils.py b/eng/versioning/utils.py
index 0b2117c61c5c..fd663de43256 100644
--- a/eng/versioning/utils.py
+++ b/eng/versioning/utils.py
@@ -27,7 +27,10 @@
# External dependency versions do not have to match semver format and the semver regular expressions
# will partially match and produce some hilarious results.
-external_dependency_version_regex = r'(?<=).+?(?=)'
+# Match version content inside or custom property tags ending with .version
+# (e.g. ). The lookahead restricts to closing tags that are
+# either or , rejecting unrelated tags like .
+external_dependency_version_regex = r'(?<=>)[^<]+(?=(?:[\w.\-]+\.)?version>)'
# This is the original regular expression for semver. This differs from the
# previous one in that start of line and end of line anchors are left in place.