Regular Expressions 101

Library entries

Time conversion

Vote

0

Regular Expression
javascript

/
(\+|\-)?(\d{1,})(?:\s|)(ms|millisecond(?:\(s\)|s|)|second(?:\(s\)|s|)|sec|s(?:\s|$)|minute(?:\(s\)|s|)|min|m(?:\s|$)|h(?:\s|$)|hour(?:\(s\)|s|)|h(?:\s|$)|day(?:\(s\)|s|)|d(?:\s|$)|week(?:\(s\)|s|)|w(?:\s|$)|month(?:\(s\)|s|)|mm(?:\s|$)|year(?:\(s\)|s|)|y(?:\s|$))(?:\s|$)?
/
gim

Description

Loading markdown...
Submitted by anonymous - 5 years ago