Pattern Match : 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 Match
Pattern Match


import java.util.regex.Pattern;

public class PatternMatchesTest {
  public static void main(String args[]) {

    String regex = "ad*";
    String input = "add";

    boolean isMatch = Pattern.matches(regex, input);
    System.out.println(isMatch);//return true
  }
}

           
       
Related examples in the same category
1. Simple PatternSimple Pattern
2. Pattern SplitPattern Split
3. Another pattern splitAnother pattern split
4. Reg Exp Example
5. PatternConvenience -- demonstrate java.util.regex.Pattern convenience routinePatternConvenience -- demonstrate java.util.regex.Pattern convenience routine
6. Simple example of using Regular Expressions functionality in String classSimple example of using Regular Expressions functionality in String class
7. Show use of Pattern.CANON_EQShow use of Pattern.CANON_EQ
8. A block of text to use as input to the regular expression matcher
9. Allows you to easly try out regular expressions
10. Regular expressions: start EndRegular expressions: start End
11. Pattern: ResettingPattern: Resetting
12. Pattern: flags Pattern: flags
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.