package qa;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Assignment1 {
	////Q: "sundaymondaytuesdaywednesdaythursday", Display this as "sunday, monday, tuesday, wednesday, thursday"
	
	public static void main(String[] args) {
		Pattern patt = null;
		Matcher match = null;
		try {
			patt = Pattern.compile("y");
			match = patt.matcher("sundaymondaytuesdaywednesdaythursday");
			
			while(match.find()==true) {
				System.out.println(match.replaceAll("y, "));
			}
		}catch(Exception e) {
			e.printStackTrace();
		}
		finally {
			patt = null;
			match = null;
		}
	}
}
