[GSOC idea] enhance regular expressions?

Peter Chadwick petevik38 at yahoo.com.au
Sat Apr 2 03:58:17 PDT 2011


Dmitry Olshansky <dmitry.olsh at gmail.com> writes:

> On 31.03.2011 22:16, petevik38 at yahoo.com.au wrote:
>> Dmitry Olshansky<dmitry.olsh at gmail.com>  writes:
>>> --- somewhat informal draft ---
>>>
>> Hi Dmitry,
>>
>> It's good to know that there is interest in improving regular
>> expressions in the D standard library. I've run into a number of
>> problems using std.regex myself, so I'm keen so see either fixes for
>> std.regex or an improved replacement.
> Thanks for the interest.
> Indeed there are problems, though the engine itself is quite capable
> and optimized, I think it could be fixed.

Great.

>> I've been working on a regular expression library myself based around
>> Russ Cox article at http://swtch.com/~rsc/regexp/regexp2.html and the
>> std.regex range interface. It includes a backtracking and Thompson
>> engine. If you are interested it is on github:
>>
>> https://github.com/PeteChadwick/pcregexeng
>>
>> The ddoc documentation is here:
>> http://petechadwick.github.com/pcregexeng/
>>
> Wow, I'll definitely look into it.
> Overall it seems solid even though incomplete. From glance it seems
> that parsing a pattern is somewhat convulted, but I'll defer any
> critics or decisions until I looked in closer detail.

I'm open to any criticisms or suggestions you may have.

> I see you also using the test from std.regex, sadly it's somewhat
> broken (the one with test vectors).
> All it's checking proves that *there is a match*, not *what* was matched.

You're right. I'm now updating the the code to make use of the other
info in the test vectors for more reliable tests.

> Anyway, I'm gathering what I have in a way of fixes as my first pull
> request, wish me luck ;)

Good luck! I look forward to seeing your work.



More information about the Digitalmars-d mailing list