Skip to content

Commit aa7f21c

Browse files
author
Daniel Kroening
authoredFeb 26, 2017
Merge pull request #530 from lucasccordeiro/string-regression
added test cases to check the string-solver
2 parents 2cf0e70 + b1de100 commit aa7f21c

File tree

217 files changed

+1911
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

217 files changed

+1911
-0
lines changed
 
Binary file not shown.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import java.util.regex.Matcher;
2+
import java.util.regex.Pattern;
3+
4+
public class RegexMatches01
5+
{
6+
public static void main(String[] args)
7+
{
8+
Pattern expression =
9+
Pattern.compile("W.*\\d[0-35-9]-\\d\\d-\\d\\d");
10+
11+
String string1 = "XXXX's Birthday is 05-12-75\n" +
12+
"YYYY's Birthday is 11-04-68\n" +
13+
"ZZZZ's Birthday is 04-28-73\n" +
14+
"WWWW's Birthday is 12-17-77";
15+
16+
Matcher matcher = expression.matcher(string1);
17+
18+
while (matcher.find())
19+
{
20+
System.out.println(matcher.group());
21+
String tmp=matcher.group();
22+
assert tmp.equals("WWWW's Birthday is 12-17-77");
23+
}
24+
}
25+
}

0 commit comments

Comments
 (0)
Please sign in to comment.