
{filelink=6525}
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class RegexCntrl {
public static void main(String[] argv) throws Exception
{
String str = "Bienvenu sur n Mesexemples.com tcopyright 2010-2012";
// Remplcer tous les caractères qui ne sont pas alphabétique et chiffre
System.out.println (str.replaceAll("[\x00-\x1F]","*"));
if("\x".matches("[\x00-\x1F]"))
System.out.println ("Le String correspond au pattern");
if(!"p ".matches("[\x00-\x1F]"))
System.out.println ("Le String ne correspond pas au pattern");
}
}