Skip to content

Commit

Permalink
Use possessive quantifiers for the duration pattern
Browse files Browse the repository at this point in the history
Since this is instructor-defined this should not have been an issue and
I cannot see the problem appear with the old regular expression, but it
cannot hurt.
  • Loading branch information
MaisiKoleni committed Mar 31, 2021
1 parent 51fe465 commit c58400f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/de/tum/in/test/api/internal/TestGuardUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public final class TestGuardUtils {
*/
private static final String ZONE_ID_START_PATTERN = "[-+A-Za-z].*";
private static final Pattern DURATION_PATTERN = Pattern
.compile("(?:(?<d>\\d+)d)?\\s*(?:\\b(?<h>\\d+)h)?\\s*(?:\\b(?<m>\\d+)m)?", Pattern.CASE_INSENSITIVE); //$NON-NLS-1$
.compile("(?:(?<d>\\d++)d)?\\s*+(?:\\b(?<h>\\d++)h)?\\s*+(?:\\b(?<m>\\d++)m)?", Pattern.CASE_INSENSITIVE); //$NON-NLS-1$

private TestGuardUtils() {

Expand Down Expand Up @@ -157,7 +157,7 @@ public static ZonedDateTime parseDeadline(String deadlineString) {
/**
* Splits the deadline string into the local time part and the time zone part if
* present
*
*
* @param deadlineString the deadline string of format ISO-LOCAL-DATE(T|
* )ISO-LOCAL-TIME( ZONE-ID)?
* @return always a string array of length two, the first part is always the
Expand Down

0 comments on commit c58400f

Please sign in to comment.