private static void scanText(final String stext, final List<String> result, final Set<String> resultSet) {
        if (stext == null) {
            return;
        }
        final String text = preprocessScanText(stext);
        final String searchText = " " + text + " ";
        final Matcher m = FORMULA_SCAN_PATTERN.matcher(searchText);
        int start = 0;
        while (m.find(start)) {
            final String found = processFoundText(Objects.requireNonNull(m.group(1)));
            if (!resultSet.contains(found) && checkCandidate(found)) {
                result.add(found);
                resultSet.add(found);
            }
            start = m.end() - 1; //move one char to left to find patterns only separated by one char
        }
    }
Holds implementations for functions in Formula
main/src/main/java/cgeo/geocaching/utils/formulas/FormulaUtils.java