From 3df84516d2a943638ae8c65170cc6506d623695f Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sat, 25 Jul 2015 00:43:48 -0400 Subject: [PATCH] RX: Was missing REG_ENHANCED, which omits \d support --- src/RX.cpp | 2 +- test/rx.t.cpp | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/RX.cpp b/src/RX.cpp index 77627131a..ccad649c3 100644 --- a/src/RX.cpp +++ b/src/RX.cpp @@ -56,7 +56,7 @@ void RX::compile () int result; if ((result = regcomp (&_regex, _pattern.c_str (), - REG_EXTENDED | REG_NEWLINE | + REG_ENHANCED | REG_EXTENDED | REG_NEWLINE | (_case_sensitive ? 0 : REG_ICASE))) != 0) { char message[256]; diff --git a/test/rx.t.cpp b/test/rx.t.cpp index cfc03a744..27b22a635 100644 --- a/test/rx.t.cpp +++ b/test/rx.t.cpp @@ -34,7 +34,7 @@ Context context; int main (int argc, char** argv) { - UnitTest ut (23); + UnitTest ut (24); // Ensure environment has no influence. unsetenv ("TASKDATA"); @@ -119,6 +119,10 @@ int main (int argc, char** argv) ut.ok (r12.match (text), text + " =~ /\\bthe\\b/"); #endif + text = "D0"; + RX r13 ("D\\d"); + ut.ok (r13.match (text), text + " =~ /D\\d/"); + return 0; }