[Python-ideas] Re: PEP Idea: native f-string support as a match pattern

2022-08-23 Thread Lucas Wiman
On Sat, Aug 13, 2022 at 10:23 AM Tushar Sadhwani < tushar.sadhwani...@gmail.com> wrote: > Stephen J. Turnbull wrote: > > I think this is a pretty unconvincing example. While people seem to > > love to hate on regular expressions, it's hard to see how that beats > > def unquote(string: str) ->

[Python-ideas] Re: PEP Idea: native f-string support as a match pattern

2022-08-13 Thread Tushar Sadhwani
Stephen J. Turnbull wrote: > I think this is a pretty unconvincing example. While people seem to > love to hate on regular expressions, it's hard to see how that beats > def unquote(string: str) -> str: > m = re.match(r"^(?:"(.*)"|'(.*)'|(?Pvalue3))$", string) RegEx feels overkill for