Pattern pattern = Pattern.compile(textPattern);
Matcher matcher = pattern.matcher(text.getText());
if (matcher.find(text.getCaretPosition())) {
text.setCaretPosition(matcher.start());
text.moveCaretPosition(matcher.end());
text.requestFocus();
return;
}
if (matcher.find(0)) {
text.setCaretPosition(matcher.start());
text.moveCaretPosition(matcher.end());