regular expression engine and ranges

ketmar via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Dec 2 11:17:32 PST 2014


Hello.

is there any decent regular expression engine which works with input
ranges? under "decent" i mean "good D code", "[t]nfa" and "no
backtracking". support for captures and greedy/non-greedy modes are
must.

i found that some popular regex libraries and std.regex are sure that
the only data layout regex engine is supposed to work with is plain
text array. now, i'm writing a small text editor (yes, another one;
please, i know that there are alot of them already! ;-) and internal
text layout is anything but plain array. yet i want to use regular
expressions for alot of things -- not only for "search that piece of
text", but for syntax highlighting (i know, i know; don't think about
it, everything is much more complicated there), navigation and so on.

i was thinking that it will not be that hard, but found that if you
want to use existing regexp engine, you *have* to either use plain
array and alot of shitcode around it for bookkeeping to please RE, or
build that plain array each time you want to use RE. this sux.

for now it seems that i have no choice except to write yet another one
regular expression engine. and this is the thing i don't want to do.
but maybe someone already did that and just don't think that it worth
publishing as we have std.regex and so?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20141202/a8055598/attachment-0001.sig>


More information about the Digitalmars-d-learn mailing list