diff --git a/configure b/configure
index f558518bb6fc351ab64570e6a92749f868b84aed..f3cf658b9e710dab2485b02888b9e1b0f680d5ac 100755
--- a/configure
+++ b/configure
@@ -13356,6 +13356,7 @@ done
 
 
 
+
 
 
 for ac_header in \
@@ -13386,6 +13387,7 @@ for ac_header in \
 	netinet/tcp.h \
 	pty.h \
 	pwd.h \
+	regex.h \
 	sched.h \
 	scsi/sg.h \
 	socket.h \
diff --git a/configure.ac b/configure.ac
index 478b2b003f41525523bf9e39dc459b7b69707fd6..c1ae4a717cf444bcff2a6c6dd91d2ba4faaea762 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1017,6 +1017,7 @@ AC_CHECK_HEADERS(\
 	netinet/tcp.h \
 	pty.h \
 	pwd.h \
+	regex.h \
 	sched.h \
 	scsi/sg.h \
 	socket.h \
diff --git a/include/config.h.in b/include/config.h.in
index 9352fe3d17c9b7870da15316a0b3d695353f127a..08631693b9598b64aeef42acd4fcfedb7a84b165 100644
--- a/include/config.h.in
+++ b/include/config.h.in
@@ -413,6 +413,9 @@
 /* Define to 1 if you have the `pwrite' function. */
 #undef HAVE_PWRITE
 
+/* Define to 1 if you have the <regex.h> header file. */
+#undef HAVE_REGEX_H
+
 /* Define to 1 if you have the `resizeterm' function. */
 #undef HAVE_RESIZETERM
 
diff --git a/programs/winedbg/hash.c b/programs/winedbg/hash.c
index c7422cc7eb1234cceeb6c880723776b212ab9805..1c67a72d419e52e1c11e775b14aebc52c55ba449 100644
--- a/programs/winedbg/hash.c
+++ b/programs/winedbg/hash.c
@@ -1335,6 +1335,8 @@ int DEBUG_SetLocalSymbolType(struct wine_locals * sym, struct datatype * type)
   return TRUE;
 }
 
+#ifdef HAVE_REGEX_H
+
 static int cmp_sym_by_name(const void * p1, const void * p2)
 {
   struct name_hash ** name1 = (struct name_hash **) p1;
@@ -1396,3 +1398,12 @@ void DEBUG_InfoSymbols(const char* str)
     }
     HeapFree(GetProcessHeap(), 0, array);
 }
+
+#else /* HAVE_REGEX_H */
+
+void DEBUG_InfoSymbols(const char* str)
+{
+    DEBUG_Printf( DBG_CHN_MESG, "FIXME: needs regex support\n" );
+}
+
+#endif /* HAVE_REGEX_H */