Java Doc for Pattern.java in  » Apache-Harmony-Java-SE » java-package » java » util » regex » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Apache Harmony Java SE » java package » java.util.regex 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.util.regex.Pattern

Pattern
final public class Pattern implements Serializable(Code)
Pattern implements a compiler for regular expressions as defined by the J2SE specification. The regular expression syntax is largely similar to the syntax defined by Perl 5 but has both omissions and extensions. A formal and complete definition of the regular expression syntax is not provided by the J2SE speTBD (TODO)


Field Summary
final static  intBACK_REF_NUMBER
    
final public static  intCANON_EQ
    
final public static  intCASE_INSENSITIVE
    
final public static  intCOMMENTS
    
final public static  intDOTALL
    
final public static  intLITERAL
    
final public static  intMULTILINE
    
final public static  intUNICODE_CASE
    
final public static  intUNIX_LINES
    
final static  boolean_DEBUG_
    
final static  intflagsBitMask
    
transient  AbstractSetstart
    


Method Summary
 intcompCount()
    
public static  Patterncompile(String regex, int flags)
     Return a compiled pattern corresponding to the input regular expression string. The input flags is a mask of the following flags:
UNIX_LINES (0x0001)
Enables UNIX lines mode where only \n is recognized as a line terminator.
public static  Patterncompile(String pattern)
    
 intconsCount()
    
public  intflags()
    
static  chargetSupplement(char ch)
     Returns supplementary character.
 intgroupCount()
    
public  Matchermatcher(CharSequence cs)
    
public static  booleanmatches(String regex, CharSequence input)
    
public  Stringpattern()
    
public static  Stringquote(String s)
    
public  String[]split(CharSequence input, int limit)
     Split an input string using the pattern as a token separator.
Parameters:
  input - Input sequence to tokenize
Parameters:
  limit - If positive, the maximum number of tokens to return.
public  String[]split(CharSequence input)
    
public  StringtoString()
     Return a textual representation of the pattern.

Field Detail
BACK_REF_NUMBER
final static int BACK_REF_NUMBER(Code)



CANON_EQ
final public static int CANON_EQ(Code)



CASE_INSENSITIVE
final public static int CASE_INSENSITIVE(Code)



COMMENTS
final public static int COMMENTS(Code)



DOTALL
final public static int DOTALL(Code)



LITERAL
final public static int LITERAL(Code)



MULTILINE
final public static int MULTILINE(Code)



UNICODE_CASE
final public static int UNICODE_CASE(Code)



UNIX_LINES
final public static int UNIX_LINES(Code)



_DEBUG_
final static boolean _DEBUG_(Code)



flagsBitMask
final static int flagsBitMask(Code)
Bit mask that includes all defined match flags



start
transient AbstractSet start(Code)





Method Detail
compCount
int compCount()(Code)



compile
public static Pattern compile(String regex, int flags) throws PatternSyntaxException(Code)
Return a compiled pattern corresponding to the input regular expression string. The input flags is a mask of the following flags:
UNIX_LINES (0x0001)
Enables UNIX lines mode where only \n is recognized as a line terminator. The default setting of this flag is off indicating that all of the following character sequences are recognized as line terminators: \n, \r, \r\n, NEL (\u0085), \u2028 and \u2029.
CASE_INSENSITIVE (0x0002)
Directs matching to be done in a way that ignores differences in case. If input character sequences are encoded in character sets other than ASCII, then the UNICODE_CASE must also be set to enable Unicode case detection.
UNICODE_CASE (0x0040)
Enables Unicode case folding if used in conjunction with the CASE_INSENSITIVE flag. If CASE_INSENSITIVE is not set, then this flag has no effect.
COMMENTS (0x0004)
Directs the pattern compiler to ignore whitespace and comments in the pattern. Whitespace consists of sequences including only these characters: SP (\u0020), HT (\t or \u0009), LF (\n or ), VT (\u000b), FF (\f or \u000c), and CR (\r or ). A comment is any sequence of characters beginning with the "#" (\u0023) character and ending in a LF character.
MULTILINE (0x0008)
Turns on multiple line mode for matching of character sequences. By default, this mode is off so that the character "^" (\u005e) matches the beginning of the entire input sequence and the character "$" (\u0024) matches the end of the input character sequence. In multiple line mode, the character "^" matches any character in the input sequence which immediately follows a line terminator and the character "$" matches any character in the input sequence which immediately precedes a line terminator.
DOTALL (0x0020)
Enables the DOT (".") character in regular expressions to match line terminators. By default, line terminators are not matched by DOT.
CANON_EQ (0x0080)
Enables matching of character sequences which are canonically equivalent according to the Unicode standard. Canonical equivalence is described here: http://www.unicode.org/reports/tr15/. By default, canonical equivalence is not detected while matching.

Parameters:
  regex - A regular expression string.
Parameters:
  flags - A set of flags to control the compilation of the pattern. A compiled pattern
throws:
  PatternSyntaxException - If the input regular expression does not match the requiredgrammar.



compile
public static Pattern compile(String pattern)(Code)



consCount
int consCount()(Code)



flags
public int flags()(Code)
Return the mask of flags used to compile the pattern A mask of flags used to compile the pattern.



getSupplement
static char getSupplement(char ch)(Code)
Returns supplementary character. At this time only for ASCII chars.



groupCount
int groupCount()(Code)
return number of groups found at compile time



matcher
public Matcher matcher(CharSequence cs)(Code)
Create a matcher for this pattern and a given input character sequence
Parameters:
  cs - The input character sequence A new matcher



matches
public static boolean matches(String regex, CharSequence input)(Code)



pattern
public String pattern()(Code)
Returns the pattern string passed to the compile method A string representation of the pattern



quote
public static String quote(String s)(Code)



split
public String[] split(CharSequence input, int limit)(Code)
Split an input string using the pattern as a token separator.
Parameters:
  input - Input sequence to tokenize
Parameters:
  limit - If positive, the maximum number of tokens to return. Ifnegative, an indefinite number of tokens are returned. Ifzero, an indefinite number of tokens are returned but trailingempty tokens are excluded. A sequence of tokens split out of the input string.



split
public String[] split(CharSequence input)(Code)



toString
public String toString()(Code)
Return a textual representation of the pattern. The regular expression string



Methods inherited from java.lang.Object
protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object object)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final public Class<? extends Object> getClass()(Code)(Java Doc)
public int hashCode()(Code)(Java Doc)
final public void notify()(Code)(Java Doc)
final public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final public void wait(long millis, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait(long millis) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.