
regexcompiler.RegexAnchor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of regex-static-analysis Show documentation
Show all versions of regex-static-analysis Show documentation
A tool to perform static analysis on regexes to determine whether they are vulnerable to ReDoS.
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