Pattern: flags : Pattern « Regular Expressions « Java

Java
1. 2D Graphics GUI
2. 3D
3. Advanced Graphics
4. Ant
5. Apache Common
6. Chart
7. Class
8. Collections Data Structure
9. Data Type
10. Database SQL JDBC
11. Design Pattern
12. Development Class
13. EJB3
14. Email
15. Event
16. File Input Output
17. Game
18. Generics
19. GWT
20. Hibernate
21. I18N
22. J2EE
23. J2ME
24. JDK 6
25. JNDI LDAP
26. JPA
27. JSP
28. JSTL
29. Language Basics
30. Network Protocol
31. PDF RTF
32. Reflection
33. Regular Expressions
34. Scripting
35. Security
36. Servlets
37. Spring
38. Swing Components
39. Swing JFC
40. SWT JFace Eclipse
41. Threads
42. Tiny Application
43. Velocity
44. Web Services SOA
45. XML
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
C# / C Sharp
C# / CSharp Tutorial
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
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
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java » Regular Expressions » PatternScreenshots 
Pattern: flags
Pattern: flags

// : c12:ReFlags.java
// From 'Thinking in Java, 3rd ed.' (c) Bruce Eckel 2002
// www.BruceEckel.com. See copyright notice in CopyRight.txt.

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class ReFlags {

  public static void main(String[] args) {
    Pattern p = Pattern.compile("^java", Pattern.CASE_INSENSITIVE
        | Pattern.MULTILINE);
    Matcher m = p.matcher("java has regex\nJava has regex\n"
        "JAVA has pretty good regular expressions\n"
        "Regular expressions are in Java");
    while (m.find())
      System.out.println(m.group());
  }
///:~



           
       
Related examples in the same category
1. Simple PatternSimple Pattern
2. Pattern MatchPattern Match
3. Pattern SplitPattern Split
4. Another pattern splitAnother pattern split
5. Reg Exp Example
6. PatternConvenience -- demonstrate java.util.regex.Pattern convenience routinePatternConvenience -- demonstrate java.util.regex.Pattern convenience routine
7. Simple example of using Regular Expressions functionality in String classSimple example of using Regular Expressions functionality in String class
8. Show use of Pattern.CANON_EQShow use of Pattern.CANON_EQ
9. A block of text to use as input to the regular expression matcher
10. Allows you to easly try out regular expressions
11. Regular expressions: start EndRegular expressions: start End
12. Pattern: ResettingPattern: Resetting
w_w__w___.___j_a__v___a___2_s._c_o__m__ | Contact Us
Copyright 2003 - 08 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.