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

regexcompiler.RegexAnchor 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 regexcompiler;

public class RegexAnchor implements RegexToken {
	
	public enum RegexAnchorType {
		LINESTART("^"),
		LINEEND("$");
		
		private final String symbol;
		
		RegexAnchorType(String symbol) {
			this.symbol = symbol;
		}
		
		public String toString() {
			return symbol;
		}
	}
	
	private final RegexAnchorType anchorType;
	public RegexAnchorType getAnchorType() {
		return anchorType;
	}
	
	private final int index;
	@Override
	public int getIndex() {
		return index;
	}

	public RegexAnchor(RegexAnchorType anchorType, int index) {
		this.index = index;
		this.anchorType = anchorType;
	}

	@Override
	public TokenType getTokenType() {
		return TokenType.ANCHOR;
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy