diff --git a/lib/bb/data_smart.py b/lib/bb/data_smart.py
index cbace8520..8aa7c1f99 100644
--- a/lib/bb/data_smart.py
+++ b/lib/bb/data_smart.py
@@ -126,7 +126,7 @@ class VariableParse:
 
         # Do not run code that contains one or more unexpanded variables
         # instead return the code with the characters we removed put back
-        if __expand_var_regexp__.findall(code):
+        if __expand_var_regexp__.search(code):
             return "${@" + code + "}"
 
         if self.varname:
