Fixing the iso format for regex patterns; fixes gh-1296

This commit is contained in:
Marcin Grzejszczak
2019-12-31 09:33:11 +01:00
parent ba9f219bd7
commit 0a7730ef16
2 changed files with 18 additions and 8 deletions

View File

@@ -85,7 +85,7 @@ public final class RegexPatterns {
protected static final Pattern NON_BLANK = Pattern.compile("^\\s*\\S[\\S\\s]*");
protected static final Pattern ISO8601_WITH_OFFSET = Pattern.compile(
"([0-9]{4})-(1[0-2]|0[1-9])-(3[01]|0[1-9]|[12][0-9])T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])(\\.\\d{3})?(Z|[+-][01]\\d:[0-5]\\d)");
"([0-9]{4})-(1[0-2]|0[1-9])-(3[01]|0[1-9]|[12][0-9])T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])(\\.\\d{1,6})?(Z|[+-][01]\\d:[0-5]\\d)");
protected static Pattern anyOf(String... values) {
return Pattern.compile(Arrays.stream(values).map(it -> '^' + it + '$')