[英]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.