Example 1: Using the regex package

IMPORT JAVA java.util.regex.Pattern
IMPORT JAVA java.util.regex.Matcher
MAIN
  DEFINE p Pattern
  DEFINE m Matcher
  LET p = Pattern.compile("[a-z]+,[a-z]+")
  DISPLAY p.pattern()
  LET m = p.matcher("aaa,bbb")
  IF m.matches() THEN
    DISPLAY "The string matches the pattern..."
  ELSE
    DISPLAY "The string does not match the pattern..."
  END IF
END MAIN