/* package whatever; // don't place package name! */ import java.util.*; import java.lang.*; import java.io.*; //import java.util.regex.*; import java.util.regex.Matcher; import java.util.regex.Pattern; /* Name of the class has to be "Main" only if the class is public. */ class Ideone { { //stackoverflow/questions/2296685/how-to-read-input-with-multiple-lines-in-java //stackoverflow/questions/56887493/how-to-take-multi-line-input-in-java search:HashmatWarrior while(myObj.hasNext()) // see if there's more { //stackoverflow/questions/10004066/java-splitting-an-input-file-by-colons if(schedParts.length>1) { if(schedParts.length>2) { //w3 schools Pattern pattern = Pattern.compile(matchMe); Matcher matcher = pattern.matcher(workTime); workTime = matcher.replaceAll(""); boolean matchFound = matcher.find(); } } else if(schedParts.length==1) { } } } }
Sun 1/5 4:30pm - 9:30pm O 0:00 Mon 1/6 5:30pm - 10:30pm O 5:00 Tue 1/7 5:30pm - 10:30pm O 5:00 Wed 1/8 Thu 1/9 Fri 1/10 Sat 1/11 Sun 1/12 4:30pm - 9:30pm O 5:00 Mon 1/13 5:30pm - 10:30pm O 5:00 Tue 1/14 5:30pm - 10:30pm O 5:00 Wed 1/15 Thu 1/16 Fri 1/17 Sat 1/18
Sun 1/5, 4:30-9:30, Mon 1/6, 5:30-10:30, Tue 1/7, 5:30-10:30, Wed 1/8, Thu 1/9, Fri 1/10, Sat 1/11, Sun 1/12, 4:30-9:30, Mon 1/13, 5:30-10:30, Tue 1/14, 5:30-10:30, Wed 1/15, Thu 1/16, Fri 1/17, Sat 1/18,