Matching Pattern using Regularexpression
This Example describe the way to match a pattern with the text by using Regularexpression.The steps involved in matching a pattern with the text are described below:String ptrn="1\\+1=2":-it is the pattern to define expression (1+1=2) using regularexpression.
String text="1+1=2":-it is the text which is to be matched with the pattern defined above.
StringConvenience.java
|
output of the program:-
1+1=2 matches 1\+1=2 |
Download Source code