Implement Absent Operator
k-takata opened this issue · 5 comments
Slide and paper by Akira Tanaka (@akr) (both Japanese):
TODO:
- Syntax:
Maybe the form of(?...)
should be used. For example(?~...)
? - Implementation:
Is it easy?
Akira's paper says that look-ahead assertion doesn't have theoretical backgrounds. However @sinya8282 says that look-ahead assertion is a regular expression (in context of formal language theory), and it can be proved by using boolean automaton.
Then absent operator can be a syntax sugar of (?:(?!expr)(?m:.))*
?
It seems that (?~expr)
is different from (?:(?!expr).)*
.
\A(?~abc)c
should match abc
(because (?~abc)
matches ab
), but \A(?:(?!abc).)*c
doesn't match.
topic/absent-operator
branch was merged into the master branch.
Maybe more tests are needed, but closing for now.
However @sinya8282 says that look-ahead assertion is a regular expression
This is discussed in a paper by Akimasa MORIHATA: