diff --git a/include/env_callback.h b/include/env_callback.h
index ab5d42dd8138be17f02ac4ad304127d55d16ea22..90b95b5e6676087f00d234721c98c7e475cf4268 100644
--- a/include/env_callback.h
+++ b/include/env_callback.h
@@ -33,8 +33,10 @@
 
 #ifdef CONFIG_REGEX
 #define ENV_DOT_ESCAPE "\\"
+#define ETHADDR_WILDCARD "\\d?"
 #else
 #define ENV_DOT_ESCAPE
+#define ETHADDR_WILDCARD
 #endif
 
 #ifdef CONFIG_CMD_DNS
@@ -53,7 +55,7 @@
 	"nvlan:nvlan," \
 	"vlan:vlan," \
 	DNS_CALLBACK \
-	"eth\\d?addr:ethaddr,"
+	"eth" ETHADDR_WILDCARD "addr:ethaddr,"
 #else
 #define NET_CALLBACKS
 #endif
diff --git a/lib/Kconfig b/lib/Kconfig
index 7ec8c98da2b32ab078f18e0802e82a9d76be45dd..c98d3997b7dec85e51a2461601fe85fb20a2c22a 100644
--- a/lib/Kconfig
+++ b/lib/Kconfig
@@ -38,6 +38,7 @@ config SYS_VSNPRINTF
 
 config REGEX
 	bool "Enable regular expression support"
+	default y if NET
 	help
 	  If this variable is defined, U-Boot is linked against the
 	  SLRE (Super Light Regular Expression) library, which adds
diff --git a/net/Kconfig b/net/Kconfig
index 9a9846e187449c5dcda44e7c84de6b12add05640..915371df91274f51701950a0ff0543cf887d8dda 100644
--- a/net/Kconfig
+++ b/net/Kconfig
@@ -4,7 +4,6 @@
 
 menuconfig NET
 	bool "Networking support"
-	select REGEX
 
 if NET