mpc_re does not support lookahead (?!...)
mgood7123 opened this issue · 7 comments
mgood7123 commented
mpc_re does not support lookahead (?!...)
mgood7123 commented
mpc_parser_t * re = mpc_new("re");
mpc_define(re, mpc_re("(?!l)."));
mpc_result_t r;
if (mpc_parse("test", "k", re, &r)) {
puts("passed");
} else {
puts("failed");
mpc_err_print(r.error);
mpc_err_delete(r.error);
}
orangeduck commented
What is the expected behavior here? I don't even think your regex has valid syntax because the ?
character is a special character...
Next time you open an issue you should add a description of exactly what the issue is - what you expected, what you got, and what you think the bug is.
orangeduck commented
Okay so you want to use a regex lookahead feature. No mpc doesn't support this and probably wont because it is too complicated to support and mpc doesn't have a complete regex engine.
mgood7123 commented
in mpc_re_mode
how are the parens processed, as
mpc_define(Base, mpc_or(4,
mpc_parens(Regex, (mpc_dtor_t)mpc_delete),
mpc_squares(Range, (mpc_dtor_t)mpc_delete),
mpc_apply_to(mpc_escape(), mpcf_re_escape, &mode),
mpc_apply_to(mpc_noneof(")|"), mpcf_re_escape, &mode)
));
is confusing
mgood7123 commented
nvm, it applies the parser Regex to whatever is inbetween the result of parens
mgood7123 commented
i cant figure out how to obtain the text captured by the parser Regex
mgood7123 commented
ughhhhhh this is imposible ;-;