|
|
@@ -9,6 +9,7 @@
|
|
|
#include <unicode/brkiter.h>
|
|
|
#include <unicode/unistr.h>
|
|
|
#endif
|
|
|
+#include <iostream>
|
|
|
|
|
|
namespace jvalidate::detail {
|
|
|
/**
|
|
|
@@ -74,12 +75,12 @@ inline std::string regex_escape(std::string_view arg) {
|
|
|
// This could be optimized to only operate when on a multibyte character
|
|
|
if (std::strchr("?*+", ucs.charAt(end))) {
|
|
|
rval.append('(');
|
|
|
- rval.append(ucs, start, end - 1);
|
|
|
+ rval.append(ucs, start, end - start);
|
|
|
rval.append(')');
|
|
|
rval.append(ucs.char32At(end));
|
|
|
end = iter->next();
|
|
|
} else {
|
|
|
- rval.append(ucs, start, end - 1);
|
|
|
+ rval.append(ucs, start, end - start);
|
|
|
}
|
|
|
start = end;
|
|
|
end = iter->next();
|