Anyways, I think I mentioned on a previous post that the ICU regex input requires strings to be C format. I made a patch for my own code base here.
Index: regexp_adapter_icu.cc
===================================================================
--- regexp_adapter_icu.cc (revision 88887)
+++ regexp_adapter_icu.cc (working copy)
@@ -17,6 +17,7 @@
#include "phonenumbers/regexp_adapter_icu.h"
+#include <stddef.h>
#include <string>
#include <unicode/regex.h>
@@ -90,10 +91,8 @@
explicit IcuRegExp(const string& utf8_regexp) {
UParseError parse_error;
UErrorCode status = U_ZERO_ERROR;
- UnicodeString unistr = UnicodeString::fromUTF8(utf8_regexp.c_str());
- RegexPattern* pattern = RegexPattern::compile(unistr, 0, parse_error, status);
-
- utf8_regexp_.reset(pattern);
+ utf8_regexp_.reset(RegexPattern::compile(
+ UnicodeString::fromUTF8(utf8_regexp.c_str()), 0, parse_error, status));
if (U_FAILURE(status)) {
// The provided regular expressions should compile correctly.
LOG(ERROR) << "Error compiling regular expression: " << utf8_regexp;