[GSOC] regular expressions beta is here

Dmitry Olshansky dmitry.olsh at gmail.com
Tue Aug 16 16:12:30 PDT 2011


On 10.08.2011 14:42, Dmitry Olshansky wrote:
>     In case I failed to mention it before, I m working on the project 
> codenamed FReD that is aimed at ~100%* source level compatible 
> overhaul of std.regex, that uses better implementation techniques, 
> provides modern Unicode support and common syntax riches.
>
>     I think it's time for a public beta release,  since it _should_ be 
> ready for mainstream usage. There are some rough edges, and a couple 
> issues that I'm aware of but they are nowhere in realistic use cases.
>
>     In order to avoid unexpected regressions I'd be glad if current 
> std.regex users do try it for their projects/tests.
> To get a small no-crap-included beta package see download section of 
> https://github.com/blackwhale/FReD for .7zs.
> I'll upload newer packages as bugs get exposed and fixed. 
> Alternatively, if you a comfortable with git you may just git clone 
> entire repo. Some helpful notes (same as README) can be found here : 
> https://github.com/blackwhale/FReD/wiki/Beta-release
>
> Caveats:
>     In order for it compile a tiny change to 2.054 source is needed 
> (no need to recompile Phobos! it's only in templates):
> patch std.algorithm.cmp according to this diff 
> https://github.com/D-Programming-Language/phobos/pull/176/files#L0L4631 <https://github.com/D-Programming-Language/phobos/pull/176/files#L0L4633> 
>
> and to get CTFE features working add if(!__ctfe) listed in the next 
> diff on the same webpage.
> (this is already upstream, so if you're using a fork of phobos just 
> pull this in)
>
> * some API problems might lead to a breaking change, though it didn't 
> happen in this release

Meanwhile the new beta is up:
https://github.com/downloads/blackwhale/FReD/FReD_beta1.7z
or checkout "stable" branch https://github.com/blackwhale/FReD/tree/stable
( as dawgfoto noticed  the master branch tend to break on 64-bit as I 
develop primarily on 32bit)

With prominent changes being:
- fixed a horrible memory corruption with regex having certain 
groups/backrefs  in lookaround

- no GC heap activity during matching in all engines, except as 
workaround for bug http://d.puremagic.com/issues/show_bug.cgi?id=6199

- new prefix searcher, featuring up to 40x search speed up on patterns 
with semi-fixed prefixes e.g. \b(https?|ftp|file)://\S+  and  
([0-9][0-9]?)/([0-9][0-9]?)/([0-9][0-9]([0-9][0-9])?)

- bool opCast for RegexMatch for nice "test if not empty syntax" as 
suggested by Steven

- lots of small fixes and optimizations

-- 
Dmitry Olshansky



More information about the Digitalmars-d mailing list