Skip to content

Commit 4dc8ec3

Browse files
committed
improved duration regex can handle fractionals properly
1 parent 904edb2 commit 4dc8ec3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/cljx/xapi_schema/schemata/regex.cljx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#"^((1\.0\.([0-9]+)(?:-([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)$")
3030

3131
(def DurationRegEx
32-
#"P(?:(?:\d+D|\d+M(?:\d+D)?|\d+Y(?:\d+M(?:\d+D)?)?)(?:T(?:\d+H(?:\d+M(?:\d+S)?)?|\d+M(?:\d+S)?|\d+S))?|T(?:\d+H(?:\d+M(?:\d+S)?)?|\d+M(?:\d+S)?|\d+S)|\d+W)")
32+
#"P(?:(?:(?:\d+D|\d+\.\d+D$)|(?:\d+M|\d+\.\d+M$)(?:\d+D|\d+\.\d+D$)?|(?:\d+Y|\d+\.\d+Y$)(:?(?:\d+M|\d+\.\d+M$)(?:\d+D|\d+\.\d+D$)?)?)(:?T(?:(?:\d+H|\d+\.\d+H$)(?:(?:\d+M|\d+\.\d+M$)(?:\d+S|\d+\.\d+S$)?)?|(?:\d+M|\d+\.\d+M$)(?:\d+S|\d+\.\d+S$)?|(?:\d+S|\d+\.\d+S$)))?|T(?:(?:\d+H|\d+\.\d+H$)(?:(?:\d+M|\d+\.\d+M$)(?:\d+S|\d+\.\d+S$)?)?|(?:\d+M|\d+\.\d+M$)(?:\d+S|\d+\.\d+S$)?|(?:\d+S|\d+\.\d+S$))|(?:\d+W|\d+\.\d+W$))")
3333

3434
(def Base64RegEx
3535
#"^(?:[A-Za-z0-9\+\/]{4})*(?:[A-Za-z0-9\+\/]{2}==|[A-Za-z0-9\+\/]{3}=|[A-Za-z0-9\+\/]{4})$")

0 commit comments

Comments
 (0)