Created
July 31, 2017 07:34
-
-
Save matthung0807/257335a9dcc77e6677c55c776c126a98 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String regex = "^he"; | |
String s = new String("hello world"); | |
Pattern p = Pattern.compile(regex); | |
Matcher m = p.matcher(s); | |
System.out.println(m.find()); // => false | |
System.out.println(m.find()); // => true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment