提取字符串中年月日的函数代码_基础知识

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

var str="sfsfsfdf2011年sfsdfsf05月随碟附送lfs23日";

str.match(/\d{4}年[01]?\d月[0123]?\d日/g)[0];

match方法得到的是一个数组

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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!