- description: 正则匹配 ISO8601 duration 时间格式 (PnYnMnDTnHnMnS)
set KEY_DURATION_REG () {
return /^-?P(?=\w*\d)(?:\d+Y|Y)?(?:\d+M|M)?(?:\d+D|D)?(?:T(?:\d+H|H)?(?:\d+M|M)?(?:\d+(?:\\.\d{1,2})?S|S)?)?$/
}
参考文章:
set KEY_DURATION_REG () {
return /^-?P(?=\w*\d)(?:\d+Y|Y)?(?:\d+M|M)?(?:\d+D|D)?(?:T(?:\d+H|H)?(?:\d+M|M)?(?:\d+(?:\\.\d{1,2})?S|S)?)?$/
}
参考文章: