View RSS Feed

Java String

Java Matcher Class

Rate this Entry
by , 04-26-2012 at 06:54 PM (496 Views)
Matcher class instances match the character sequences, against string pattern. Matchers are provided with input by CharSequence so that to provide support to matching, against characters from input sources.

Pattern helps to create the matcher when pattern’s matcher method is invoked. Once it has been made, different match operations could be performed by matcher.
  • Whole input sequence is matched by the matcher method against the pattern.
  • Input sequence is matched by the lookingAt method against the pattern.
  • Input sequence is scaned by the final method, which is looked for the proceding sequence which will be matching the pattern,



A Boolean is returned by these methods which indicate the failure or success. Details regading successful match may be obtained when the state of matcher is being queried.

Methods are also defined by this class to replace the matched sequences, by new string. Content of them could be computed by the help of match result.

Submit "Java Matcher Class" to Facebook Submit "Java Matcher Class" to Digg Submit "Java Matcher Class" to del.icio.us Submit "Java Matcher Class" to StumbleUpon Submit "Java Matcher Class" to Google

Categories
Regex

Comments