diff --git a/ports/esp32/mpconfigport.h b/ports/esp32/mpconfigport.h
index aeb8c44116e1e95e239c74281f42e4bf966732a1..495861b65934eeb64de56a9ba2806bbf7d45f6b4 100644
--- a/ports/esp32/mpconfigport.h
+++ b/ports/esp32/mpconfigport.h
@@ -122,6 +122,7 @@
 #define MICROPY_PY_UZLIB                    (1)
 #define MICROPY_PY_UJSON                    (1)
 #define MICROPY_PY_URE                      (1)
+#define MICROPY_PY_URE_SUB                  (1)
 #define MICROPY_PY_UHEAPQ                   (1)
 #define MICROPY_PY_UTIMEQ                   (1)
 #define MICROPY_PY_UHASHLIB                 (1)
diff --git a/ports/esp8266/mpconfigport.h b/ports/esp8266/mpconfigport.h
index a5b149d803a2025b4f3dd08dfc1b292d7509de61..78967c31dfb1c3e33f8cf4a13c0e4fe6e2467ae9 100644
--- a/ports/esp8266/mpconfigport.h
+++ b/ports/esp8266/mpconfigport.h
@@ -75,6 +75,7 @@
 #define MICROPY_PY_UJSON            (1)
 #define MICROPY_PY_URANDOM          (1)
 #define MICROPY_PY_URE              (1)
+#define MICROPY_PY_URE_SUB          (1)
 #define MICROPY_PY_USELECT          (1)
 #define MICROPY_PY_UTIME_MP_HAL     (1)
 #define MICROPY_PY_UZLIB            (1)
diff --git a/ports/esp8266/mpconfigport_512k.h b/ports/esp8266/mpconfigport_512k.h
index 60c14883ef0e993e76cde3776050733b0c19eba5..df670d4c96b725817021c2bebebbe97a00206959 100644
--- a/ports/esp8266/mpconfigport_512k.h
+++ b/ports/esp8266/mpconfigport_512k.h
@@ -32,6 +32,9 @@
 #undef MICROPY_PY_FRAMEBUF
 #define MICROPY_PY_FRAMEBUF             (0)
 
+#undef MICROPY_PY_URE_SUB
+#define MICROPY_PY_URE_SUB              (0)
+
 #undef MICROPY_PY_UCRYPTOLIB
 #define MICROPY_PY_UCRYPTOLIB           (0)
 
diff --git a/ports/stm32/mpconfigport.h b/ports/stm32/mpconfigport.h
index a038664e83b7ffb919c35e970bac389095aa04f5..9149a5338ee2f6da6f6cb9ac2967e10c127438e9 100644
--- a/ports/stm32/mpconfigport.h
+++ b/ports/stm32/mpconfigport.h
@@ -127,6 +127,7 @@
 #define MICROPY_PY_UZLIB            (1)
 #define MICROPY_PY_UJSON            (1)
 #define MICROPY_PY_URE              (1)
+#define MICROPY_PY_URE_SUB          (1)
 #define MICROPY_PY_UHEAPQ           (1)
 #define MICROPY_PY_UHASHLIB         (1)
 #define MICROPY_PY_UBINASCII        (1)