public static String value2Regex(String value){ return '^'+escapeRegex(value)+'$'; } /**
public static String value2Regex(String value){ return '^'+escapeRegex(value)+'$'; } /**
public static String escapeRegex(String value){ return escapeRegex(value, null).toString(); } /**
public static String escapeRegex(String value){ return escapeRegex(value, null).toString(); } /**
/** * Creates a regex that matches vales against whole words * ('<code>\b{value}\b</code>) * @param word the word to match * @return the regex to match words * @since 0.12.1 */ public static String word2Regex(String word){ return escapeRegex(word, new StringBuilder("\\b")).append("\\b").toString(); }
/** * Creates a regex that matches vales against whole words * ('<code>\b{value}\b</code>) * @param word the word to match * @return the regex to match words * @since 0.12.1 */ public static String word2Regex(String word){ return escapeRegex(word, new StringBuilder("\\b")).append("\\b").toString(); }