Re: [Patch] Fix regex `nosubs` correctly

2014-01-21 Thread Tim Shen
On Tue, Jan 21, 2014 at 2:39 PM, Jonathan Wakely wrote: > OK, thanks for confirming that. In that case your patch is OK to > commit. Committed. > I'll raise a defect report against the standard as I don't think the > specification of nosubs is clear. If that's what it means then it > should be

Re: [Patch] Fix regex `nosubs` correctly

2014-01-21 Thread Jonathan Wakely
On 21/01/14 14:14 -0500, Tim Shen wrote: My conclusion is actually based on Boost.Regex's behavior. boost::basic_regex::mark_count() returns 1 with nosubs flag. Note that boost::basic_regex::mark_count() == std::basic_regex::mark_count() + 1, because std does not count the 0th capture (the whole

Re: [Patch] Fix regex `nosubs` correctly

2014-01-21 Thread Tim Shen
On Tue, Jan 21, 2014 at 5:08 AM, Jonathan Wakely wrote: > What does Boost.Regex do? My conclusion is actually based on Boost.Regex's behavior. boost::basic_regex::mark_count() returns 1 with nosubs flag. Note that boost::basic_regex::mark_count() == std::basic_regex::mark_count() + 1, because std

Re: [Patch] Fix regex `nosubs` correctly

2014-01-21 Thread Jonathan Wakely
On 20/01/14 17:43 -0500, Tim Shen wrote: The semantic of `nosubs` should simply be that `let all parentheses not be a subexpression and do not capture it`. It's not clear to me whether the standard says that nosubs implies mark_count() == 0 or that the mark count remains the same, but no sub-ex

[Patch] Fix regex `nosubs` correctly

2014-01-20 Thread Tim Shen
The semantic of `nosubs` should simply be that `let all parentheses not be a subexpression and do not capture it`. Tested with -m64 and -m32 respectively. Thank you! -- Regards, Tim Shen commit 6972b7eb795adb462182ec96684cc94b7bb8a338 Author: tim Date: Mon Jan 20 17:33:44 2014 -0500 20