language: Java (sun-jdk-1.7.0_10)
date: 573 days 5 hours ago
link:
visibility: public
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.04s    memory: 213440 kB     returned value: 0

    10/12/2010