Work around a bug in CMake that breaks `^` anchors.

https://gitlab.kitware.com/cmake/cmake/-/issues/16899 was reported
seven years ago. The bug existed at least ten years ago. It hasn't
been fixed.

Change-Id: Ifbe3e77ce6371091b24303d5c4953d401ed29826
Reviewed-on: https://code-review.googlesource.com/c/re2/+/63071
Reviewed-by: Alex Chernyakhovsky <achernya@google.com>
Reviewed-by: Paul Wankadia <junyer@google.com>
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2f8a1c7..b838a3a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -152,7 +152,9 @@
 endif()
 
 foreach(dep ${ABSL_DEPS})
-  string(REGEX REPLACE "^absl_" "absl::" dep ${dep})
+  # Work around https://gitlab.kitware.com/cmake/cmake/-/issues/16899. >:(
+  string(PREPEND dep "^")
+  string(REGEX REPLACE "\\^absl_" "absl::" dep ${dep})
   target_link_libraries(re2 PUBLIC ${dep})
 endforeach()