public class RegexDistanceUtils extends Object
| Constructor and Description |
|---|
RegexDistanceUtils() |
| Modifier and Type | Method and Description |
|---|---|
static String |
expandRegex(String regex)
Java regular expressions contain predefined character classes which the
regex parser cannot handle
|
protected static dk.brics.automaton.Automaton |
getAndCacheAutomaton(String regex) |
static double |
getDistanceTailoredForStringAVM(String arg,
String regex)
Get the distance between the arg and the given regex.
|
static String |
getNonMatchingRegexInstance(String regex) |
static dk.brics.automaton.Automaton |
getRegexAutomaton(String regex) |
static String |
getRegexInstance(String regex) |
static int |
getStandardDistance(String arg,
String regex)
Get the distance between the arg and the given regex.
|
protected static String |
removeFlagExpressions(String regex) |
protected static String |
removeReluctantOperators(String regex) |
public static dk.brics.automaton.Automaton getRegexAutomaton(String regex)
public static String expandRegex(String regex)
regex - public static int getStandardDistance(String arg, String regex)
Get the distance between the arg and the given regex. All operations (insertion/deletion/replacement) cost 1. There is no assumption on where and how the operations can be done (ie all sequences are valid).
public static double getDistanceTailoredForStringAVM(String arg, String regex)
Get the distance between the arg and the given regex. Insertion/deletion cost 1, whereas replacement is in [0,1] depending on the actual character values.
Note: the distance is tailored for the StringAVM algorithm, in which characters are only inserted/appended at the end.
arg - regex - protected static dk.brics.automaton.Automaton getAndCacheAutomaton(String regex)
Copyright © 2010–2017 EvoSuite. All rights reserved.