Discount 40% off. Post navigation JAVA program to count number of vowels, consonants, digits,white spaces and special characters in a given string. In Java language you can easily print number pattern using for loop and also using while loop, here i will show you in simple way to print these all patterns. Pattern modifiers are placed directly after the regular expression, for example, if you want to search for a pattern in a case-insensitive manner, you can use the i modifier, like this: /pattern/i.. Pattern attribute support from caniuse.com. :-) Star Patterns in Java. Making statements based on opinion; back them up with references or personal experience.