Home > Web Front-end > JS Tutorial > Function code to extract year, month and day from string_Basic knowledge

Function code to extract year, month and day from string_Basic knowledge

WBOY
Release: 2016-05-16 17:17:29
Original
1686 people have browsed it

var str="sfsfsfdf2011 sfsdfsf05 comes with the CD on lfs23rd";

str.match(/d{4}year[01]?dmonth[0123]?d day/g)[0];

The match method gets an array

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template