[Boost-bugs] [Boost C++ Libraries] #12959: Regex class negation

Subject: [Boost-bugs] [Boost C++ Libraries] #12959: Regex class negation
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2017-04-10 00:24:17


#12959: Regex class negation
------------------------------+-------------------------
 Reporter: robic@… | Owner: johnmaddock
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: regex
  Version: Boost 1.61.0 | Severity: Showstopper
 Keywords: |
------------------------------+-------------------------
 Pertains to boost::regex
 Tested on version 1.61

 Flags: Perl[[BR]]
 Target string: abc092efg[[BR]]
 Regex: `[^\W\D]+`[[BR]]

 Function: regex_search[[BR]]

 Matches: abc092efg[[BR]]

 Should match: 092[[BR]]

 Notes[[BR]]

 Negative class resolution: 'Not-Not Word' AND 'Not-Not Digit'[[BR]]
 The intersection of word AND digits is digits.[[BR]]

 Every other regex engine does this correctly.[[BR]]
 This includes Perl, PCRE, JS, C++11, Python, etc..[[BR]]

 In this engine, `[^\W\D]` matches what `[\w\d]` does.[[BR]]
 `[^\W\D]` appears not to be an intersection as the operator in[[BR]]
 a negative class is AND.[[BR]]

 Fwiw - this behavior is seen with all negated shorthand elements of
 a[[BR]]
 negative class, i.e. `[^\S\W]` matches all whitespace OR all word
 char's.[[BR]]

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/12959>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-04-10 00:26:57 UTC