Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Ticket #1344 (new defect)

Opened 16 years ago

Last modified 14 years ago

Regex fails on \0

Reported by: grignaak Assigned to: larsivi
Priority: normal Milestone: 1.0
Component: Core Functionality Version: 0.99.7 Dominik
Keywords: Regex Cc:

Description

The following regex does not work as expected:

auto r = Regex("[a\0]|b[a\0]");
char[] txt = "dddbad\0";
re.test

It matches on the last character of the string instead of the "ba" portion.

Compare it to

auto r = Regex("[a\n]|b[a\n]");
char[] txt = "dddbad\n";
re.test

which matches on the expected "ba" portion.

Change History

10/26/08 05:21:49 changed by kris

  • owner changed from sean to jascha.

03/27/09 01:45:55 changed by dhasenan

To be painfully obvious about what's happening: That regular expression should match 'a', '\0', 'ba', and 'b\0'. In the example, it did not match 'ba' or 'a', but it matched '\0'.

03/29/09 15:04:34 changed by larsivi

  • milestone changed from 0.99.8 to 0.99.9.

02/07/10 21:39:42 changed by larsivi

  • milestone changed from 0.99.9 to 1.0.

06/06/10 20:00:55 changed by kris

  • owner changed from jascha to larsivi.