<commit_before>package org.unix4j.unix.grep;

import org.unix4j.line.Line;

import java.util.regex.Pattern;

/**
 * A matcher using regular expressions to match the pattern with a line. Uses
 * Java's {@Link Pattern} to do the regexp stuff.
 */
class RegexpMatcher implements LineMatcher {

	private final Pattern pattern;

	public RegexpMatcher(GrepArguments args) {
		if(args.isPatternSet()){
			this.pattern = args.getPattern();
		} else if(args.isPatternStrSet()){
			final String regex;
			if (args.isWholeLine()) {
				regex = args.getPatternStr();
			} else {
				regex = ".*" + args.getPatternStr() + ".*";
			}
			this.pattern = Pattern.compile(regex, args.isIgnoreCase() ? Pattern.CASE_INSENSITIVE : 0);
		} else {
			throw new IllegalArgumentException("Either pattern, or patternStr must be given");
		}
	}

	@Override
	public boolean matches(Line line) {
		// NOTE: we use content here because . does not match line
		// ending characters, see {@link Pattern#DOTALL}
		boolean matches = pattern.matcher(line.getContent()).matches();
		return matches;
	}
}
<commit_msg>Checking in broken java file to test hudson server.<commit_after>package org.unix4j.unix.grep;

import org.unix4j.line.Line;

import java.util.regex.Pattern;

/**
 * A matcher using regular expressions to match the pattern with a line. Uses
 * Java's {@Link Pattern} to do the regexp stuff.
 */
class RegexpMatcher implements LineMatcher {

	private final Pattern pattern;

	public RegexpMatcher(GrepArguments args) {
		if(args.isPatternSet()){
			this.pattern = args.getPattern();
		} else if(args.isPatternStrSet()){
			final String regex;
			if (args.isWholeLine()) {
				regex = args.getPatternS tr();
			} else {
				regex = ".*" + args.getPatternStr() + ".*";
			}
			this.pattern = Pattern.compile(regex, args.isIgnoreCase() ? Pattern.CASE_INSENSITIVE : 0);
		} else {
			throw new IllegalArgumentException("Either pattern, or patternStr must be given");
		}
	}

	@Override
	public boolean matches(Line line) {
		// NOTE: we use content here because . does not match line
		// ending characters, see {@link Pattern#DOTALL}
		boolean matches = pattern.matcher(line.getContent()).matches();
		return matches;
	}
}

{'fraction_non_alphanumeric': 0.12232833105957254, 'fraction_numerical': 0.002728512960436562, 'mean_word_length': 3.8997772828507795, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1922151', 'n_tokens_mistral': 751, 'n_tokens_neox': 681, 'n_words': 195}