Skip to content

ShigekiKarita/re2d

Folders and files

NameName
Last commit message
Last commit date

Latest commit

b642545 Β· Aug 17, 2021

History

15 Commits
Aug 5, 2021
Aug 6, 2021
Aug 5, 2021
Aug 5, 2021
Aug 5, 2021
Aug 17, 2021
Aug 5, 2021

Repository files navigation

This project was moved to https://github.com/google/re2d

re2d

linux codecov Dub version

D language binding of RE2 regex engine.

LICENSE: same as RE2 (BSD 3-clause).

Usage

/+ dub.json:
{
  "dependencies": {
     "re2d": "*"
  },
  "libs": ["re2", "c++"]
}
+/
import re2d;

@nogc nothrow pure unittest {
  int i;
  StringPiece s;
  assert(RE2.FullMatch("γƒ«γƒ“γƒΌπŸ’Ž:1234", `([^:]+):(\d+)`, &s, &i));
  assert(s.toString == "γƒ«γƒ“γƒΌπŸ’Ž");
  assert(i == 1234);
}

You need to install RE2 library in $LIBRARY_PATH and $LD_LIBRARY_PATH before building.

See re2.d unittests for more runnable examples.