<commit_before>package org.jsoup;

/**
 Text utils to ease testing

 @author <NAME>, <EMAIL> */
public class TextUtil {
    public static String stripNewlines(String text) {
        return text.replaceAll("\\r?\\n\\s*", "");
    }
}
<commit_msg>Don't recompile regex on each hit<commit_after>package org.jsoup;

import java.util.regex.Pattern;

/**
 Text utils to ease testing

 @author <NAME>, <EMAIL> */
public class TextUtil {
    static Pattern stripper = Pattern.compile("\\r?\\n\\s*");

    public static String stripNewlines(String text) {
        return stripper.matcher(text).replaceAll("");
    }
}

{'fraction_non_alphanumeric': 0.1477832512315271, 'fraction_numerical': 0.0, 'mean_word_length': 3.4525547445255476, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '656135', 'n_tokens_mistral': 193, 'n_tokens_neox': 192, 'n_words': 51}