[libc++] Use __is_exactly_{input, forward}_iterator

Reviewed By: ldionne, #libc

Spies: libcxx-commits

Differential Revision: https://reviews.llvm.org/D128646

NOKEYCHECK=True
GitOrigin-RevId: 00927334df9a8133a5112c0450349d546373316f
diff --git a/include/regex b/include/regex
index a117c50..bd04017 100644
--- a/include/regex
+++ b/include/regex
@@ -2748,12 +2748,7 @@
 
     template <class _InputIterator>
         _LIBCPP_INLINE_VISIBILITY
-        typename enable_if
-        <
-             __is_cpp17_input_iterator  <_InputIterator>::value &&
-            !__is_cpp17_forward_iterator<_InputIterator>::value,
-            basic_regex&
-        >::type
+        typename enable_if<__is_exactly_cpp17_input_iterator<_InputIterator>::value, basic_regex&>::type
         assign(_InputIterator __first, _InputIterator __last,
                             flag_type __f = regex_constants::ECMAScript)
         {