Recognize Regular Language in JavaFX