[英]Approximate matching of regular expressions in java
我正在寻找类似于commons-text -LevenshteinDetailedDistance
东西,但使用正则表达式。
e.g
LevenshteinDetailedDistance d = new LevenshteinDetailedDistance();
LevenshteinResults levenshteinResults = d.apply("SomeText", "Some Text");
the result will be like below
Distance: 1, Insert: 1, Delete: 0, Substitute: 0
//方法-字符串相差1个字符
是否有任何类似的库可用于java中正则表达式的近似匹配?
例如。
String regularEX = ".*Some Text 1.*"
Pattern pattern = Pattern.compile(regularEX, Pattern.CASE_INSENSITIVE | Pattern.DOTALL | Pattern.MULTILINE);
pattern.matcher("anyPrefixText Some Text").matches(); // this will retrun false - but as only one chatterer is missing - i want to get that difference
我可以为此使用任何内置库吗?
我没有东西有这样的图书馆。 我不知道有什么能告诉您错过比赛的距离。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.