Class ReplacementScanner

    • Method Detail

      • replaceTokens

        public static CharSequence replaceTokens​(@NonNull
                                                 CharSequence text,
                                                 @NonNull
                                                 Pattern pattern,
                                                 Function<Matcher,​CharSequence> replacementFunction)
        Search for instances of pattern in text. Replace each matching occurrence using the replacementFunction.
        Parameters:
        text - the text to search
        pattern - the pattern to search for
        replacementFunction - a function that will provided the replacement text
        Returns:
        the resulting text after replacing matching occurrences in text