mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-20 04:13:07 +02:00
RX: Was missing REG_ENHANCED, which omits \d support
This commit is contained in:
parent
4f0e32b69b
commit
3df84516d2
2 changed files with 6 additions and 2 deletions
|
@ -56,7 +56,7 @@ void RX::compile ()
|
||||||
|
|
||||||
int result;
|
int result;
|
||||||
if ((result = regcomp (&_regex, _pattern.c_str (),
|
if ((result = regcomp (&_regex, _pattern.c_str (),
|
||||||
REG_EXTENDED | REG_NEWLINE |
|
REG_ENHANCED | REG_EXTENDED | REG_NEWLINE |
|
||||||
(_case_sensitive ? 0 : REG_ICASE))) != 0)
|
(_case_sensitive ? 0 : REG_ICASE))) != 0)
|
||||||
{
|
{
|
||||||
char message[256];
|
char message[256];
|
||||||
|
|
|
@ -34,7 +34,7 @@ Context context;
|
||||||
|
|
||||||
int main (int argc, char** argv)
|
int main (int argc, char** argv)
|
||||||
{
|
{
|
||||||
UnitTest ut (23);
|
UnitTest ut (24);
|
||||||
|
|
||||||
// Ensure environment has no influence.
|
// Ensure environment has no influence.
|
||||||
unsetenv ("TASKDATA");
|
unsetenv ("TASKDATA");
|
||||||
|
@ -119,6 +119,10 @@ int main (int argc, char** argv)
|
||||||
ut.ok (r12.match (text), text + " =~ /\\bthe\\b/");
|
ut.ok (r12.match (text), text + " =~ /\\bthe\\b/");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
text = "D0";
|
||||||
|
RX r13 ("D\\d");
|
||||||
|
ut.ok (r13.match (text), text + " =~ /D\\d/");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue