Find a date string with regular expression : Date Parse « Date Time « JavaScript DHTML






Find a date string with regular expression

  

<html>
<head>
<title>Find Date</title>
</head>
<body>
<script type="text/javascript">
var regExp = /:\D*\s\d+\s\d+/;
var str = "This is a date: March 12 2008";
var resultString = str.match(regExp);
document.writeln("Date" + resultString);

</script>
</body>
</html>

   
    
  








Related examples in the same category

1.Date parse Example
2.Use regular expression to check a date