For string S1, it is determined whether it is digital Pattern PartGood = Pattern.Compile ("^ // D "); matcher mpartGood = PartGood.matcher (strcontent); if (! MpartGood.find ()) {...} 2 , Judgment 1111.11 format pattern allgood = pattern.Compile ("^ // D {4,} //./// D {2,}"); matcher mallgood = AllGood.matcher (StrContent); if (MallGood.Find () ) {...}