/** * Compiles the given String into a Pattern that can be used to match text. * The syntax is normal for Java, including backslashes as part of regex syntax, like the digit shorthand "\d", * escaped twice to "\\d" (so the double-quoted String itself doesn't try to interpret the backslash). * @param regex a String in normal Java regular expression format * @return a newly constructed Pattern object that can be used to match text that fits the given regular expression * @throws PatternSyntaxException */ public static Pattern compile(String regex) throws PatternSyntaxException{ return new Pattern(regex, DEFAULT); } //java.util.regex.* compatibility
/** * Compiles the given String into a Pattern that can be used to match text. * The syntax is normal for Java, including backslashes as part of regex syntax, like the digit shorthand "\d", * escaped twice to "\\d" (so the double-quoted String itself doesn't try to interpret the backslash). * @param regex a String in normal Java regular expression format * @return a newly constructed Pattern object that can be used to match text that fits the given regular expression * @throws PatternSyntaxException when there is a syntax error in the Pattern */ public static Pattern compile(String regex) throws PatternSyntaxException{ return new Pattern(regex, DEFAULT); } //java.util.regex.* compatibility
/** * Compiles the given String into a Pattern that can be used to match text. * The syntax is normal for Java, including backslashes as part of regex syntax, like the digit shorthand "\d", * escaped twice to "\\d" (so the double-quoted String itself doesn't try to interpret the backslash). * <br> * This variant allows flags to be passed as an int constructed via bitwise OR from REFlags constants. You may prefer * the variant that takes a String for clarity. * @param regex a String in normal Java regular expression format * @param flags integer flags that are constructed via bitwise OR from the flag constants in REFlags. * @return a newly constructed Pattern object that can be used to match text that fits the given regular expression * @throws PatternSyntaxException when there is a syntax error in the Pattern */ public static Pattern compile(String regex,int flags) throws PatternSyntaxException{ return new Pattern(regex, flags); } //java.util.regex.* compatibility
/** * Compiles the given String into a Pattern that can be used to match text. * The syntax is normal for Java, including backslashes as part of regex syntax, like the digit shorthand "\d", * escaped twice to "\\d" (so the double-quoted String itself doesn't try to interpret the backslash). * <br> * This variant allows flags to be passed as an int constructed via bitwise OR from REFlags constants. You may prefer * the variant that takes a String for clarity. * @param regex a String in normal Java regular expression format * @param flags integer flags that are constructed via bitwise OR from the flag constants in REFlags. * @return a newly constructed Pattern object that can be used to match text that fits the given regular expression * @throws PatternSyntaxException */ public static Pattern compile(String regex,int flags) throws PatternSyntaxException{ return new Pattern(regex, flags); } //java.util.regex.* compatibility
/** * Compiles the given String into a Pattern that can be used to match text. * The syntax is normal for Java, including backslashes as part of regex syntax, like the digit shorthand "\d", * escaped twice to "\\d" (so the double-quoted String itself doesn't try to interpret the backslash). * <br> * This variant allows flags to be passed as an String. * The flag string should consist of letters 'i','m','s','x','u','X'(the case is significant) and a hyphen or plus. * The meaning of letters: * <ul> * <li><b>i</b> - case insensitivity, corresponds to REFlags.IGNORE_CASE;</li> * <li><b>m</b> - multiline treatment(BOLs and EOLs affect the '^' and '$'), corresponds to REFlags.MULTILINE flag;</li> * <li><b>s</b> - single line treatment('.' matches \r's and \n's),corresponds to REFlags.DOTALL;</li> * <li><b>x</b> - extended whitespace comments (spaces and eols in the expression are ignored), corresponds to REFlags.IGNORE_SPACES.</li> * <li><b>u</b> - predefined classes are regarded as belonging to Unicode, corresponds to REFlags.UNICODE; this may yield some performance penalty.</li> * <li><b>X</b> - compatibility with XML Schema, corresponds to REFlags.XML_SCHEMA.</li> * <li><b>-</b> - turn off the specified flags; normally has no effect unless something adds the flags.</li> * <li><b>+</b> - turn on the specified flags; normally is no different from just using the letters.</li> * </ul> * * @param regex a String in normal Java regular expression format * @param flags integer flags that are constructed via bitwise OR from the flag constants in REFlags. * @return a newly constructed Pattern object that can be used to match text that fits the given regular expression * @throws PatternSyntaxException when there is a syntax error in the Pattern */ public static Pattern compile(String regex,String flags) throws PatternSyntaxException{ return new Pattern(regex, flags); }
/** * Compiles the given String into a Pattern that can be used to match text. * The syntax is normal for Java, including backslashes as part of regex syntax, like the digit shorthand "\d", * escaped twice to "\\d" (so the double-quoted String itself doesn't try to interpret the backslash). * <br> * This variant allows flags to be passed as an String. * The flag string should consist of letters 'i','m','s','x','u','X'(the case is significant) and a hyphen or plus. * The meaning of letters: * <ul> * <li><b>i</b> - case insensitivity, corresponds to REFlags.IGNORE_CASE;</li> * <li><b>m</b> - multiline treatment(BOLs and EOLs affect the '^' and '$'), corresponds to REFlags.MULTILINE flag;</li> * <li><b>s</b> - single line treatment('.' matches \r's and \n's),corresponds to REFlags.DOTALL;</li> * <li><b>x</b> - extended whitespace comments (spaces and eols in the expression are ignored), corresponds to REFlags.IGNORE_SPACES.</li> * <li><b>u</b> - predefined classes are regarded as belonging to Unicode, corresponds to REFlags.UNICODE; this may yield some performance penalty.</li> * <li><b>X</b> - compatibility with XML Schema, corresponds to REFlags.XML_SCHEMA.</li> * <li><b>-</b> - turn off the specified flags; normally has no effect unless something adds the flags.</li> * <li><b>+</b> - turn on the specified flags; normally is no different from just using the letters.</li> * </ul> * * @param regex a String in normal Java regular expression format * @param flags integer flags that are constructed via bitwise OR from the flag constants in REFlags. * @return a newly constructed Pattern object that can be used to match text that fits the given regular expression * @throws PatternSyntaxException */ public static Pattern compile(String regex,String flags) throws PatternSyntaxException{ return new Pattern(regex, flags); }
public static Pattern deserializeFromString(String ser) { return new Pattern(ser.substring(0, ser.length() - 1), ser.charAt(ser.length() - 1) >>> 1); } }