Here you can find the source of addEscapeCapacityToRegex(String inputRegex)
Parameter | Description |
---|---|
inputRegex | the Regex string to be added the capacity |
public static String addEscapeCapacityToRegex(String inputRegex)
//package com.java2s; //License from project: Open Source License public class Main { private static final String ESCAPE_CHARACTER = ";"; /**// ww w.j a va2 s. co m * This will encode the given Regex string the capacity to ignore the * escaped word, i.e. word preceded by the {@link ESCAPE_CHARACTER}. * * @param inputRegex the Regex string to be added the capacity * @return the new Regex that include the capacity to ignore the escaped word. */ public static String addEscapeCapacityToRegex(String inputRegex) { return String.format("(?<!%1$s)%2$s", ESCAPE_CHARACTER, inputRegex); } }