API Overview API Index Package Overview Direct link to this page
JDK 1.6
  java.util.regex. Pattern View Source
Author(s)
Mike McCloskey
Mark Reinhold
JSR-51 Expert Group
Since
1.4
Version
1.124, 07/03/15
Serial
Hierarchy
 Object
      Pattern
Implements
 Serializable
Subclasses
Description
publicfinal class Pattern
  A compiled representation of a regular expression.
Constructors
private Pattern (String p, int f)
  This private constructor is used to create all Patterns.
Methods
Hide/Show inherited methods
publicstatic Pattern compile (String regex)
  Compiles the given regular expression into a pattern.
publicstatic Pattern compile (String regex, int flags)
  Compiles the given regular expression into a pattern with the given flags.
public int flags ()
  Returns this pattern's match flags.
public Matcher matcher (CharSequence input)
  Creates a matcher that will match the given input against this pattern.
publicstatic boolean matches (String regex, CharSequence input)
  Compiles the given regular expression and attempts to match the given input against it.
public String pattern ()
  Returns the regular expression from which this pattern was compiled.
publicstatic String quote (String s)
  Returns a literal pattern String for the specified String.
public String split (CharSequence input)
  Splits the given input sequence around matches of this pattern.
public String split (CharSequence input, int limit)
  Splits the given input sequence around matches of this pattern.
public String toString ()
  Returns the string representation of this pattern.
Fields
Hide/Show inherited fields
pack-privatestatic Node accept
This must be the very first initializer.
pack-privatetransient int buffer
Temporary storage used by parsing pattern slice.
publicfinalstatic int CANON_EQ = "128"
  Enables canonical equivalence.
pack-privatetransient int capturingGroupCount
  The number of capturing groups in this Pattern.
publicfinalstatic int CASE_INSENSITIVE = "2"
  Enables case-insensitive matching.
publicfinalstatic int COMMENTS = "4"
  Permits whitespace and comments in pattern.
publicfinalstatic int DOTALL = "32"
  Enables dotall mode.
pack-privatefinalstatic int GREEDY = "0"
pack-privatetransient GroupHead groupNodes
Temporary storage used while parsing group references.
pack-privatefinalstatic int INDEPENDENT = "3"
pack-privatestatic Node lastAccept
pack-privatefinalstatic int LAZY = "1"
publicfinalstatic int LITERAL = "16"
  Enables literal parsing of the pattern.
pack-privatetransient int localCount
  The local variable count used by parsing tree.
pack-privatestatic Node lookbehindEnd
For use with lookbehinds; matches the position where the lookbehind was encountered.
pack-privatetransient Node matchRoot
  The root of object tree for a match operation.
pack-privatefinalstatic int MAX_REPS = "2147483647"
publicfinalstatic int MULTILINE = "8"
  Enables multiline mode.
pack-privatefinalstatic int POSSESSIVE = "2"
pack-privatetransient Node root
  The starting point of state machine for the find operation.
publicfinalstatic int UNICODE_CASE = "64"
  Enables Unicode-aware case folding.
publicfinalstatic int UNIX_LINES = "1"
  Enables Unix lines mode.
Nested Classes
  Pattern.TreeInfo
Used to accumulate information about a subtree of the object graph so that optimizations can be applied to the subtree.
  Pattern.Node
Base class for all node classes.
  Pattern.LastNode
  Pattern.Start
Used for REs that can start anywhere within the input string.
  Pattern.StartS
  Pattern.Begin
Node to anchor at the beginning of input.
  Pattern.End
Node to anchor at the end of input.
  Pattern.Caret
Node to anchor at the beginning of a line.
  Pattern.UnixCaret
Node to anchor at the beginning of a line when in unixdot mode.
  Pattern.LastMatch
Node to match the location where the last match ended.
  Pattern.Dollar
Node to anchor at the end of a line or the end of input based on the multiline mode.
  Pattern.UnixDollar
Node to anchor at the end of a line or the end of input based on the multiline mode when in unix lines mode.
  Pattern.SingleS
Node class that matches a Supplementary Unicode character
  Pattern.Single
Optimization -- matches a given BMP character
  Pattern.SingleI
Case insensitive matches a given BMP character
  Pattern.SingleU
Unicode case insensitive matches a given Unicode character
  Pattern.Category
Node class that matches a Unicode category.
  Pattern.Ctype
Node class that matches a POSIX type.
  Pattern.SliceNode
Base class for all Slice nodes
  Pattern.Slice
Node class for a case sensitive/BMP-only sequence of literal characters.
  Pattern.SliceI
Node class for a case_insensitive/BMP-only sequence of literal characters.
  Pattern.SliceU
Node class for a unicode_case_insensitive/BMP-only sequence of literal characters.
  Pattern.SliceS
Node class for a case sensitive sequence of literal characters including supplementary characters.
  Pattern.SliceIS
Node class for a case insensitive sequence of literal characters including supplementary characters.
  Pattern.SliceUS
Node class for a case insensitive sequence of literal characters.
  Pattern.All
Implements the Unicode category ALL and the dot metacharacter when in dotall mode.
  Pattern.Dot
Node class for the dot metacharacter when dotall is not enabled.
  Pattern.UnixDot
Node class for the dot metacharacter when dotall is not enabled but UNIX_LINES is enabled.
  Pattern.Ques
The 0 or 1 quantifier.
  Pattern.Curly
Handles the curly-brace style repetition with a specified minimum and maximum occurrences.
  Pattern.GroupCurly
Handles the curly-brace style repetition with a specified minimum and maximum occurrences in deterministic cases.
  Pattern.BranchConn
A Guard node at the end of each atom node in a Branch.
  Pattern.Branch
Handles the branching of alternations.
  Pattern.GroupHead
The GroupHead saves the location where the group begins in the locals and restores them when the match is done.
  Pattern.GroupRef
Recursive reference to a group in the regular expression.
  Pattern.GroupTail
The GroupTail handles the setting of group beginning and ending locations when groups are successfully matched.
  Pattern.Prolog
This sets up a loop to handle a recursive quantifier structure.
  Pattern.Loop
Handles the repetition count for a greedy Curly.
  Pattern.LazyLoop
Handles the repetition count for a reluctant Curly.
  Pattern.BackRef
Refers to a group in the regular expression.
  Pattern.CIBackRef
  Pattern.First
Searches until the next instance of its atom.
  Pattern.Conditional
  Pattern.Pos
Zero width positive lookahead.
  Pattern.Neg
Zero width negative lookahead.
  Pattern.Behind
Zero width positive lookbehind.
  Pattern.BehindS
Zero width positive lookbehind, including supplementary characters or unpaired surrogates.
  Pattern.NotBehind
Zero width negative lookbehind.
  Pattern.NotBehindS
Zero width negative lookbehind, including supplementary characters or unpaired surrogates.
  Pattern.Bound
Handles word boundaries.
  Pattern.BnM
Attempts to match a slice in the input using the Boyer-Moore string matching algorithm.
  Pattern.BnMS
Supplementary support version of BnM().
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar