public Optional<String> getFirstMatch(String text) {
        if (text == null || text.isEmpty() || words.isEmpty()) {
            return Optional.empty();
        }

        String haystack = searchCache.computeIfAbsent(text, WordBoundaryMatcher::splitWords);
        for (String needle : words) {
            if (testWordMatch(needle, haystack)) {
                return Optional.of(needle);
            }
        }

        return Optional.empty();
    }
Returns the first term that the input text matched.
@param text the String within which to search for matches
@return the first match found
smithy-linters/src/main/java/software/amazon/smithy/linters/WordBoundaryMatcher.java