public static List<DailyRestriction> parseString(String restrictionString) {
        
        List<DailyRestriction> restrictions = new ArrayList<>();
        Matcher restrictionMatcher = RESTRICTION_REGEX.matcher(restrictionString);
        
        // Loop through RegEx matches
        while (restrictionMatcher.find()) {
            
            // Pull the day string, start time, and end time
            String dayString = restrictionMatcher.group(RESTRICTION_DAY_GROUP);
            String startTimeString = restrictionMatcher.group(RESTRICTION_TIME_START_GROUP);
            String endTimeString = restrictionMatcher.group(RESTRICTION_TIME_END_GROUP);
            LocalTime startTime, endTime;
            
            // We must always have a value for the day.
            if (dayString == null || dayString.isEmpty())
                continue;
                        
            // Convert the start and end time strings to LocalTime values.
            DateTimeFormatter hourFormat = DateTimeFormatter.ofPattern("HHmm");
            
            // If start time is empty, assume the start of the day.
            if (startTimeString == null || startTimeString.isEmpty())
                startTime = LocalTime.of(0, 0, 0);
            
            // Otherwise, parse out the start time.
            else
                startTime = LocalTime.parse(startTimeString, hourFormat);
            
            // If end time is empty, assume the end of the day.
            if (endTimeString == null || endTimeString.isEmpty())
                endTime = LocalTime.of(23, 59, 59);
            
            // Otherwise, parse out the end time.
            else
                endTime = LocalTime.parse(endTimeString, hourFormat);
            
            // Based on value of day string, add the appropriate entry.
            switch(dayString) {
                // All days of the week.
                case "*":
                    restrictions.add(new DailyRestriction(RESTRICTION_ALL_DAYS, startTime, endTime));
                    break;
                    
                // A specific day of the week.
                default:
                    int dayInt = Integer.parseInt(dayString);
                    
                    // While JavaScript sees Sunday as "0" and "7", DayOfWeek
                    // does not, so we'll convert it to "7" in order to process it.
                    if (dayInt == 0)
                        dayInt = 7;
                    
                    restrictions.add(new DailyRestriction(DayOfWeek.of(dayInt), startTime, endTime));
                    
            }
            
        }
        
        // Return the list of restrictions
        return restrictions;
        
    }
Parse the provided string containing one or more restrictions into
a list of objects.

@param restrictionString
    The string that should contain one or more semicolon-separated
    restriction periods.

@return 
    A list of objects parsed from the string.
extensions/guacamole-auth-restrict/src/main/java/org/apache/guacamole/calendar/TimeRestrictionParser.java