chapel-lang / chapel

a Productive Parallel Programming Language
https://chapel-lang.org
Other
1.75k stars 410 forks source link

[Feature Request]: separate way to initialize literal and posix regular expressions #24942

Open mppf opened 2 weeks ago

mppf commented 2 weeks ago

This issue is a spin-off from issue #24788. That issue identified several problems with the regex initializer that have to do with posix mode regular expressions. One wrinkle that continues to exist is that nonGreedy doesn't do anything for posix mode regular expressions. And, pretty much none of the options will do anything for literal regular expressions.

The feature request in this issue is to have seperate initializers or factory functions for creating literal and posix-mode regular expressions. The rationale here is that these modes need different optional flags than the usual regular expressions.

At present, I don't think this can be done with different initializers, because it will result in ambiguity with the existing initializer (which we don't want to deprecate because it is stable). However issue #24825 proposes a way to allow it to be handled with different initializers.

The other alternative is to create factory functions for this.