public
String pattern()
Returns
the regular expression from which this pattern was compiled.
import java.util.regex.*; public class PatternMatch { public static void main(String args[]){ Pattern p = Pattern.compile("a*b"); System.out.println("Pattern used is " + p.pattern()); } }
Output
Pattern used is a*b
No comments:
Post a Comment