public static Pattern compile (String regExp) { return new Pattern(regExp); }
public static Pattern compile (String regExp) { return new Pattern(regExp); }
/** * Equivalent to {@code Pattern.compile(pattern, 0)}. */ public static Pattern compile(String pattern) { return new Pattern(pattern, 0); }
/** * Returns a compiled form of the given {@code regularExpression}, as modified by the * given {@code flags}. See the <a href="#flags">flags overview</a> for more on flags. * * @throws PatternSyntaxException if the regular expression is syntactically incorrect. * * @see #CANON_EQ * @see #CASE_INSENSITIVE * @see #COMMENTS * @see #DOTALL * @see #LITERAL * @see #MULTILINE * @see #UNICODE_CASE * @see #UNIX_LINES */ public static Pattern compile(String regularExpression, int flags) throws PatternSyntaxException { return new Pattern(regularExpression, flags); }
/** * Tests whether the given {@code regularExpression} matches the given {@code input}. * Equivalent to {@code Pattern.compile(regularExpression).matcher(input).matches()}. * If the same regular expression is to be used for multiple operations, it may be more * efficient to reuse a compiled {@code Pattern}. * * @see Pattern#compile(java.lang.String, int) * @see Matcher#matches() */ public static boolean matches(String regularExpression, CharSequence input) { return new Matcher(new Pattern(regularExpression, 0), input).matches(); }
/** * Equivalent to {@code Pattern.compile(pattern, 0)}. */ public static Pattern compile(String pattern) { return new Pattern(pattern, 0); }
/** * Equivalent to {@code Pattern.compile(pattern, 0)}. */ public static Pattern compile(String pattern) { return new Pattern(pattern, 0); }
/** * Equivalent to {@code Pattern.compile(pattern, 0)}. */ public static Pattern compile(String pattern) { return new Pattern(pattern, 0); }
/** * Equivalent to {@code Pattern.compile(pattern, 0)}. */ public static Pattern compile(String pattern) { return new Pattern(pattern, 0); }
/** * Compiles the given regular expression into a pattern. </p> * * @param regex * The expression to be compiled * * @throws PatternSyntaxException * If the expression's syntax is invalid */ public static Pattern compile(String regex) { return new Pattern(regex, 0); }
/** * Compiles the given regular expression into a pattern. * @param regex The expression to be compiled */ public static Pattern compile(String regex) { Pattern pattern= new Pattern(); pattern.pattern= regex; return pattern; }
String current; while ((current = buff.readLine()) != null) { System.out.println(current); Pattern p = new Pattern(current); resultList.add(p); }
import java.util.regex.Matcher; import java.util.regex.Pattern; public String matchID(String data) { Pattern r = new Pattern("(france\\d+Id)=([a-zA-Z0-9]+),"); Matcher m = r.matcher(data); return m.group(2); }
/** * Tests whether the given {@code regularExpression} matches the given {@code input}. * Equivalent to {@code Pattern.compile(regularExpression).matcher(input).matches()}. * If the same regular expression is to be used for multiple operations, it may be more * efficient to reuse a compiled {@code Pattern}. * * @see Pattern#compile(java.lang.String, int) * @see Matcher#matches() */ public static boolean matches(String regularExpression, CharSequence input) { return new Matcher(new Pattern(regularExpression, 0), input).matches(); }
/** * Tests whether the given {@code regularExpression} matches the given {@code input}. * Equivalent to {@code Pattern.compile(regularExpression).matcher(input).matches()}. * If the same regular expression is to be used for multiple operations, it may be more * efficient to reuse a compiled {@code Pattern}. * * @see Pattern#compile(java.lang.String, int) * @see Matcher#matches() */ public static boolean matches(String regularExpression, CharSequence input) { return new Matcher(new Pattern(regularExpression, 0), input).matches(); }
/** * Tests whether the given {@code regularExpression} matches the given {@code input}. * Equivalent to {@code Pattern.compile(regularExpression).matcher(input).matches()}. * If the same regular expression is to be used for multiple operations, it may be more * efficient to reuse a compiled {@code Pattern}. * * @see Pattern#compile(java.lang.String, int) * @see Matcher#matches() */ public static boolean matches(String regularExpression, CharSequence input) { return new Matcher(new Pattern(regularExpression, 0), input).matches(); }
/** * Tests whether the given {@code regularExpression} matches the given {@code input}. * Equivalent to {@code Pattern.compile(regularExpression).matcher(input).matches()}. * If the same regular expression is to be used for multiple operations, it may be more * efficient to reuse a compiled {@code Pattern}. * * @see Pattern#compile(java.lang.String, int) * @see Matcher#matches() */ public static boolean matches(String regularExpression, CharSequence input) { return new Matcher(new Pattern(regularExpression, 0), input).matches(); }
/** * Tests whether the given {@code regularExpression} matches the given {@code input}. * Equivalent to {@code Pattern.compile(regularExpression).matcher(input).matches()}. * If the same regular expression is to be used for multiple operations, it may be more * efficient to reuse a compiled {@code Pattern}. * * @see Pattern#compile(java.lang.String, int) * @see Matcher#matches() */ public static boolean matches(String regularExpression, CharSequence input) { return new Matcher(new Pattern(regularExpression, 0), input).matches(); }
Pattern p = new Pattern("(/{0,2})([^/]+)"); Matcher m = p.matcher(str); while(m.find()) { String token = m.group(2); String delimiter = m.group(1); // (preceding delimiter. may be null) /* * ... */ }