Combining two regular expressions A and B into C = (A and not B)
问题 Let's say I have one regular expression A and another regular expression B as input. I want to create a new regular expression C which matches a line if and only if A matches the line and B does not match the line. I am able to manually create C for very simple cases of A and B : Let's say A is x and B is y , then C = ^[^y]*x[^y]*$ would be a valid solution. Obviously, the problem gets harder as A and B get more complex. Is there a generic algorithm for creating such a regular expression C