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