All Downloads are FREE. Search and download functionalities are using the official Maven repository.

matcher.driver.MatcherDriver Maven / Gradle / Ivy

Go to download

A tool to perform static analysis on regexes to determine whether they are vulnerable to ReDoS.

There is a newer version: 1.0.8
Show newest version
package matcher.driver;

import matcher.*;
import regexcompiler.*;

import analysis.AnalysisSettings.NFAConstruction;

public class MatcherDriver {

	public static void main(String args[]) {
		if (args.length < 2) {
			System.out.println("usage: java MatcherDriver  ");
			System.exit(0);
		}
		String pattern = args[0];
		String inputString = args[1];
		MyPattern myPattern = MyPattern.compile(pattern, NFAConstruction.JAVA);
		MyMatcher myMatcher = myPattern.matcher(inputString);
		boolean matches = myMatcher.matches();
		System.out.println(pattern + " matches " + inputString + ": " + matches);
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy