C++ Logo

std-proposals

Advanced search

Re: [std-proposals] does std:regex require exception support?

From: Yongwei Wu <wuyongwei_at_[hidden]>
Date: Sat, 29 Aug 2026 20:37:11 +0800
On Sat, 29 Aug 2026 at 19:05, mm-studios via Std-Proposals <
std-proposals_at_[hidden]> wrote:

> Hi C++ enthusiasts!,
>
> I've been hinted by AI that "std::regex can't be used with exceptions
> disabled"
>
> if that's true, I'd suggest to improve the std supporting the
> exception-haters group, which I presume I belong to.
>
> I have only the time to leave the suggestion, in case anyone is motivated
> to pick it up.
>

If you do not bother, why should other people?

In reality, as long as you pass valid regular expressions to the
constructor, it should work, as exemplified below:

https://godbolt.org/z/Tafvxn4cf

By the way, if you really hate exceptions, you should stop using strings,
containers, shared_ptr, etc. At least in theory they all can throw.

Received on 2026-08-29 12:37:32