问题
We have 2 versions of a text T
before and after,
before:
a\nb\n
after:
b\n
define regex ^[^\n].*\n$
as Line,
define operation delete_line
of deleting a substring that match Line from a text,
define operation add_line
of adding a substring that match Line from a text,
Obviously, T
can transform with operation delete_line
.
is there a library that give a general solution of this problem?
Given a set of regex ,it will calculate if the text can transform before to after.
来源:https://stackoverflow.com/questions/54017344/transform-text-with-given-pattern