Saturday 1 November 2014

Exploring Pattern class

Pattern object represents a compiled representation of a regular expression.

Methods in Pattern class
Method
Description
public static Pattern compile(String regex)
Compiles the given regular expression into a pattern.
public static Pattern compile(String regex, int flags)
Compiles the given regular expression into a pattern with the given flags.
public String pattern()
Returns the regular expression from which this pattern was compiled.
public String toString()
Returns the string representation of this pattern.
public Matcher matcher(CharSequence input)
Creates a matcher that will match the given input against this pattern.
public int flags()
Returns this pattern's match flags.
public static boolean matches(String regex, CharSequence input)
Compiles the given regular expression and attempts to match the given input against it.
public String[] split(CharSequence input, int limit)
Splits the given input sequence around matches of this pattern.





Prevoius                                                 Next                                                 Home

No comments:

Post a Comment