Commit 559c1786 authored by Phillip Webb's avatar Phillip Webb

Simplify regex expressions

parent 09815cc9
......@@ -36,7 +36,7 @@ public enum DurationStyle {
/**
* Simple formatting, for example '1s'.
*/
SIMPLE("^([\\+\\-]?\\d+)([a-zA-Z]{0,2})$") {
SIMPLE("^([+-]?\\d+)([a-zA-Z]{0,2})$") {
@Override
public Duration parse(String value, ChronoUnit unit) {
......@@ -62,7 +62,7 @@ public enum DurationStyle {
/**
* ISO-8601 formatting.
*/
ISO8601("^[\\+\\-]?P.*$") {
ISO8601("^[+-]?P.*$") {
@Override
public Duration parse(String value, ChronoUnit unit) {
......
......@@ -102,7 +102,7 @@ public enum PeriodStyle {
/**
* ISO-8601 formatting.
*/
ISO8601("^[\\+\\-]?P.*$", 0) {
ISO8601("^[+-]?P.*$", 0) {
@Override
public Period parse(String value, ChronoUnit unit) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment