[Bug libstdc++/77469] std::regex x("[b\\-a]") throws with message "Invalid range in bracket expression."

schwab@linux-m68k.org gcc-bugzilla@gcc.gnu.org
Sun Sep 4 06:04:00 GMT 2016


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77469

Andreas Schwab <schwab@linux-m68k.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID

--- Comment #4 from Andreas Schwab <schwab@linux-m68k.org> ---
\ is not special inside bracket expressions, [b\-a] means b and the range
between \ and a.  If you want to include a - in a bracket expression, put it
first or last.


More information about the Gcc-bugs mailing list