fork download
  1. import java.util.regex.*;
  2.  
  3. class Main
  4. {
  5. public static void main (String[] args) throws java.lang.Exception
  6. {
  7. String input = "a>b&!c";
  8. final String mainRegex = "(.*?)(&!|&|==)(.*)";
  9. final Matcher matcher = Pattern.compile(mainRegex).matcher(input);
  10. if (matcher.matches())
  11. {
  12. System.out.println("match");
  13. }
  14. else
  15. {
  16. System.out.println("no match");
  17. }
  18. }
  19. }
Success #stdin #stdout 0.03s 245632KB
stdin
Standard input is empty
stdout
match