Package RegEx; public class regexs {public static void main (string ARGs []) {// Regular Expression cut // splitshow ("Monday, Tuesday, third ",","); // splitshow ("moday. tureday. third ","\\. "); // follow. cut // splitshow ("moday Tuesday third", "+"); // cut by space // splitshow ("C: \ Windows \ System ", "\\\\"); // file path cutting // splitshow ("dafakkafafgjjjfafaaa", "([A-Z]) \ 1 + "); // replaceallshow ("afa461341af13463420.afawfafa", "\ D {5, 10}", "#") for overlapping word cutting // Replace the regular expression }","#"); // replace the number with #/** to remove the repeated characters in a string. This is useful in ***/replaceallshow ("aaabbbcddd", "([A-Z]). \ 1 + "," $1 "); // remove duplicate connections, only one}/** Regular Expression cut ***/public static void splitshow (string STR, string RegEx) {string result [] = Str. split (RegEx); For (string S: result) system. out. println (s);}/** replace regular expression ***/public static void replaceallshow (string STR, string RegEx, string newstr) {STR = Str. replaceall (RegEx, newstr); system. out. println (STR );}}