Skip to content

Instantly share code, notes, and snippets.

@peters
Created July 8, 2015 11:23
Show Gist options
  • Save peters/8dd900ab8a8e5af17aa3 to your computer and use it in GitHub Desktop.
Save peters/8dd900ab8a8e5af17aa3 to your computer and use it in GitHub Desktop.
diff --git a/src/openalpr/postprocess/regexrule.cpp b/src/openalpr/postprocess/regexrule.cpp
index c4bf857..be2871f 100644
--- a/src/openalpr/postprocess/regexrule.cpp
+++ b/src/openalpr/postprocess/regexrule.cpp
@@ -75,11 +75,11 @@ namespace alpr
}
else if (utf_character == "@")
{
- this->regex = this->regex + "\\p{Alpha}";
+ this->regex = this->regex + "\p{Alpha}";
}
else if (utf_character == "#")
{
- this->regex = this->regex + "\\p{Digit}";
+ this->regex = this->regex + "\p{Digit}";
}
else if ((utf_character == "*") || (utf_character == "+"))
{
@matthill
Copy link

matthill commented Jul 8, 2015

Doing that disables the pattern matching, unfortunately. It sounds like it may be a bug in the Regex library... one that will be very difficult to troubleshoot. I added a minor change today (using stringstream to build the regex rather than concatenating strings). I doubt that will help, but worth a shot. At least it's slightly more efficient.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment