Regular Expressions 101

Sponsors

Library entries

1
javascript

HTML注释

HTML注释
Submitted by anonymous - 2 months ago
1
javascript

phone regex

phone regex
Submitted by antiai - a month ago
1
javascript

提取步骤1

提取步骤1
Submitted by liangchao - a month ago
1
javascript

array path

Extract the array path from a nested path
Submitted by anonymous - 8 days ago
1
javascript

Match HMTL/WXML tag and class

Match HMTL/WXML tag and class
Submitted by ice breaker - 6 days ago
2
javascript

Simple URL

Validate an URL input.
Submitted by @nuragic - 4 months ago

Date - Extract & Validate - Fully tested - Format YYYY-MM-DD (dynamic parts separator / can use a different separator)

Vote

2

Regular Expression
javascript

/
(?<=\D|^)(?<year>\d{4})(?<sep>[^\w\s])(?<month>1[0-2]|0[1-9])\k<sep>(?<day>0[1-9]|[12][0-9]|(?<=11\k<sep>|[^1][4-9]\k<sep>)30|(?<=1[02]\k<sep>|[^1][13578]\k<sep>)3[01])(?=\D|$)
/
gm

Description

Loading markdown...
Submitted by Elie Grenon (DrunkenPoney) <elie.grenon.1@gmail.com> - 2 years ago