| The Java interface / Getting started with the Java interface | |
IMPORT JAVA java.util.regex.Pattern
MAIN
DEFINE p Pattern
LET p = Pattern.compile("[,\\s]+")
END MAIN
IMPORT JAVA java.util.regex.Pattern
IMPORT JAVA java.util.regex.Matcher
MAIN
DEFINE Pattern Pattern
DEFINE Matcher Matcher
-- static method, needs full qualifier
LET Pattern = java.util.regex.Pattern.compile("[a-z]+")
-- regular instance method, Pattern resolves to variable
LET Matcher = Pattern.matcher("abcdef")
END MAIN
Note that in Genero, program variables are case-insensitive (Pattern = pattern).