Skip to content

Instantly share code, notes, and snippets.

@wpik
Created March 4, 2019 06:54
Show Gist options
  • Select an option

  • Save wpik/65fb959b052c39b88d552247735f4f9b to your computer and use it in GitHub Desktop.

Select an option

Save wpik/65fb959b052c39b88d552247735f4f9b to your computer and use it in GitHub Desktop.
RFC3339 timestamp regex
private static final Pattern RFC3339_TIMESTAMP_PATTERN = Pattern.compile(
"^(\\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])(?:T|t)" +
"([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60)(\\.[0-9]+)?" +
"(?:Z|z|(\\+|-)([01][0-9]|2[0-3]):([0-5][0-9]))$"
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment