C++ Logo

std-proposals

Advanced search

Re: [std-proposals] regex over istreams

From: Zhihao Yuan <zy_at_[hidden]>
Date: Fri, 21 Feb 2025 00:01:42 +0000
On Thursday, February 20th, 2025 at 1:35 PM, Phil Bouchard via Std-Proposals <std-proposals_at_[hidden]> wrote:

>

> On 2/20/25 16:17, Jonathan Wakely wrote:
> > This uses a hardcoded regular expression to extract from the stream.
> > That doesn't seem very useful. Surely you would want to be able to
> > customize the regex? What API are you proposing for that?
>

>

> This is just an example function. My goal is to write a robust parser
> using standard C++ operator >>.

Are you looking for

https://github.com/taocpp/PEGTL

?

https://github.com/taocpp/PEGTL/blob/main/doc/Inputs-and-Parsing.md#stream-inputs

--
Zhihao Yuan, ID lichray
The best way to predict the future is to invent it.
_______________________________________________

Received on 2025-02-21 00:01:49