aka Fast Regular Expressions for D
Switch branches/tags
Nothing to show
Clone or download
Dmitry Olshansky
Latest commit d83d1cc Oct 10, 2017
Permalink
Failed to load latest commit information.
bench Latest additions: Rust and refresh RE2/PCRE Oct 10, 2017
tools Cleanup, add d build and bench scripts Jun 9, 2015
README Update README Jun 15, 2015

README

Fast Regular Expressions for D (FReD)
a project proposed as source level compatible replacement for std.regex 
After being accepted into Phobos FReD repository is used for various tools & benchmarks of std.regex, that can't go into D core repo for obvious reasons. 

Package contents
--------------------------
bench\*          - sample programs for benchmarking (D vs other languages/libraries)
tools\*          - various helper tools for code generation and self testing

Building
--------------------------

If you just need a test tool to give you a head start, you can compile d_r.d from bench, usage is:
fred_r pattern file [print]
Use the "" around pattern to keep away your shell interpreter that is always hungry for special characters.

Build scripts and benchmark harness are work in progress at the moment.

Notes for testers
--------------------------
While project is mature enough for mainstream usage (barring CTFE parts), there could be some bugs in the hiding.
Things to keep an eye for:
    - something that doesn't compile with FReD, but did with std.regex
    - hits on assert(0) and access violation :o)
    - innocent looking pattern takes enormous time to match, particularly
      if it's two mostly identical patterns that have drastically different performance
    - character set operations (particularly subtraction (--) and intersection (&&))
    - interesting case insensitve matching (i.e. unicode characters/texts)
    - Unicode conformance, see level 1 at http://unicode.org/reports/tr18/
    - static regexes, this is not for the faint of heart, but if you can get CTFE internal error 
      and able to reduce it then please do it :)
    - there are 3 different regex engines (counting C-T for static regexes) 
      to invoke traditional backtracking engine use bmatch instead of match

Now that it's in the Phobos proper, all bugs should be reported to http://d.puremagic.com/issues

Please don't hesitate to include bogus pattern, test _input_, OS and compiler version
Any additional tests on e.g. conformance are also welcome.

Know some really good regex library Brand X (for c/c++ preferably?) Please do tell.