develooper Front page | perl.perl5.porters | Postings from February 2022

Conditional qualifiers

Thread Next
From:
sasho648
Date:
February 28, 2022 17:38
Subject:
Conditional qualifiers
Message ID:
CACcOKpYxEtOBRMZ6AgOpYSV+OJdkHW9jKDdo3bM=p6Judt054g@mail.gmail.com
I found needing something like this for clarity:

(?=(?<qualifiers>(int|char)(?{areweinfilescope}*+|++)))\g{qualifiers}

This way if are we in file scope the quantifiers will be captured optional
and then the backreference will work as expected too.

Currently this gives the following error:

Quantifier follows nothing in regex;


Thus I don't think any backwards compatibility will be broken.

Thanks for the attention - hope you find my suggestion somewhat captivating.

Alexander Nikolov

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About