I've stumbled upon a regex question.
How to validate a subtract equation like this?
A string subtract another string equals to whatever remains(all the terms are just plain strings, not sets. So ab and ba are different strings).
Pass
abc-b=acabcde-cd=abeab-a=babcde-a=bcdeabcde-cde=ab
Fail
abc-a=cabcde-bd=aceabc-cd=ababcde-a=cdeabc-abc=abc-=abc
Here's what I tried and you may play around with it