Regular Expressions 101

Library entries

Time duration from minutes to weeks suffixed by letter and whitespace separated

Vote

1

Regular Expression
javascript

/
^(?<weeks>\d{1,2})w\s(?<days>0?[0-6])d\s(?<hours>(?:0?|1|2(?=[0-3]))\d)h\s(?<minutes>(?:0?|[1-5])\d)m$
/
i

Description

Loading markdown...
Submitted by Dorin Popa - 6 months ago