[swift-evolution] Empower String type with regular expression

Patrick Gili gili.patrick.r at gili-labs.com
Tue Feb 2 07:58:30 CST 2016


Okay, I didn't know Perl was open source. I'll look at the Perl6 regular expression link you sent me.

Cheers,
-Patrick

> On Feb 1, 2016, at 6:55 PM, Chris Lattner <clattner at apple.com> wrote:
> 
> 
>> On Feb 1, 2016, at 2:03 PM, Patrick Gili <gili.patrick.r at gili-labs.com> wrote:
>> 
>> Hi Chris,
>> 
>> Appreciate the pointer. Let me look at this further. Do you know of any open source effort that implements this?
> 
> I’m not sure what you mean.  Perl 6 is a large effort and all of it is open source AFAIK.
> 
> -Chris
> 
>> 
>> Cheers,
>> -Patrick
>> 
>>> On Feb 1, 2016, at 4:55 PM, Chris Lattner <clattner at apple.com> wrote:
>>> 
>>> 
>>>> On Feb 1, 2016, at 6:47 AM, Patrick Gili <gili.patrick.r at gili-labs.com> wrote:
>>>> 
>>>> Hi Chris,
>>>> 
>>>> Thank you for the feedback; it is much appreciated.
>>>> 
>>>> I like the idea of folding this into the language's pattern grammar. It makes it more Swifty. I didn't see that direction, and I will investigate it further.
>>>> 
>>>> I have been looking a lot at Perl 6. In fact, a lot of languages these days use PCRE or PCRE2, which was based on Perl's implementation of regular expressions. Does this mean there is attitude to move away from the regular expression implementation used by the foundation today?
>>> 
>>> PCRE is based on Perl 5 regular expressions.  You are correct that they are well known and widely used, but they also have a lot of problems, and Perl 6 made them a lot better.
>>> 
>>> This is the first hit I had for “Perl 6 regex”:
>>> http://doc.perl6.org/language/regexes
>>> 
>>> Things I like about them:
>>> 1) They mostly use the standard regex operator grammar x?, x*, x+, etc.
>>> 2) They allow free form style.
>>> 3) They allow comments within them.
>>> 4) Unicode aware and correct.
>>> 5) They are checked and validated by the compiler (not just a string fed into a runtime call).
>>> 
>>> etc.
>>> 
>>> 
>>> 
>>> 
>>> -Chris
>>> 
>> 
> 



More information about the swift-evolution mailing list