I want to write a regex pattern which find strings containts only: p, q, r, ^, v and ~ signs, but also implication and equivalence, represented by two (=>) or three (<=>) signs. How can I do that?
For example that pattern:
Pattern pattern = Pattern.compile("[(=>)(<=>)]*");
Matches strings that contains: (, =, >, <, ) signs, whereas I want to write a pattern which contains only *=>* and *<=>*.