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

preprocessor.NonpreciseSubstitutionPreprocessor 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 preprocessor;

public class NonpreciseSubstitutionPreprocessor extends ParsingPreprocessor {
	public NonpreciseSubstitutionPreprocessor() {		
		super();
		ALLOW_LOOKAROUND = true;
		DequantifierRule dr = new DequantifierRule(); /* we first need to remove the quantifying symbols */
		addRule(dr);
		EscapeSequenceExpansionRule eer = new EscapeSequenceExpansionRule();
		addRule(eer);
		WildCardExpansionRule wcer = new WildCardExpansionRule();
		addRule(wcer);
		PlusOperatorExpansion poe = new PlusOperatorExpansion();
		addRule(poe);
		QuestionMarkOperatorExpansion qmoe = new QuestionMarkOperatorExpansion();
		addRule(qmoe);
		//CountClosureOperatorExpansion ccoe = new CountClosureOperatorExpansion();
		//addRule(ccoe);
		NonpreciseCountClosureOperatorExpansion nlccoe = new NonpreciseCountClosureOperatorExpansion();
		addRule(nlccoe);
		NonpreciseLookaroundExpansion nlae = new NonpreciseLookaroundExpansion();
		addRule(nlae);
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy