code: public Optional<HString> matchFirst(HString text) {
        TokenMatcher matcher = new TokenMatcher(nfa, text);
        if (matcher.find()) {
           return Optional.of(matcher.group());
        }
        return Optional.empty();
     }
docs: Match first optional.
  
  @param text the text
  @return the optional