1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | import java.util.regex.*; class Main { public static void main (String[] args) throws java.lang.Exception { String subjectString = "data 10/12/2010, data, data"; String ResultString = null; try { Pattern regex = Pattern.compile("\\b[0-9]{2}/[0-9]{2}/[0-9]{4}\\b"); Matcher regexMatcher = regex.matcher(subjectString); if (regexMatcher.find()) { ResultString = regexMatcher.group(); System.out.println(ResultString ); } } catch (PatternSyntaxException ex) { // Syntax error in the regular expression } } } |
-
upload with new input
-
result: Success time: 0.07s memory: 380224 kB returned value: 0
date of creation: Mon Dec 17 22:30:26 2012
10/12/2010
-
result: Success time: 0.03s memory: 245632 kB returned value: 0
12-31-2012
10/12/2010
-
result: Success time: 0.03s memory: 245632 kB returned value: 0
10-1-2012
10/12/2010
-
result: Success time: 0.03s memory: 245632 kB returned value: 0
5_^y7&978
10/12/2010
-
result: Success time: 0.02s memory: 245632 kB returned value: 0
1/1/75
10/12/2010
-
result: Success time: 0.02s memory: 245632 kB returned value: 0
12-31-2012
10/12/2010
-
result: Success time: 0.03s memory: 245632 kB returned value: 0
11-1-2012
10/12/2010
-
result: Success time: 0.04s memory: 213440 kB returned value: 0
10/12/2010


