2
I need a String template that starts with letter, has no space, accepts numbers, is case sensitive, (uppercase and minuscule) and does not accept special characters or accents, (will be the name of a table in the database) so I wanted something that worked as a filter to accept or not. What is the best way to do this? The ideal was to point out what is outside, but not necessarily.
Today I do something like this:
    String escreve = (escrevetabela.getText().toString()).replaceAll(" ","");
                if(escreve.indexOf("0")==0||escreve.indexOf("1")==0||
                        escreve.indexOf("2")==0||escreve.indexOf("3")==0||
                        escreve.indexOf("4")==0||escreve.indexOf("5")==0||
                        escreve.indexOf("6")==0||escreve.indexOf("7")==0||
                        escreve.indexOf("8")==0||escreve.indexOf("9")==0||
                        escreve.indexOf("9")==0){
mas como descobri que caracteres especial da problema também, essa lista de ous ia ficar um tanto extensa. 
Using the answer below with some modifications was like this:
    ok.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                String escreve = (escrevetabela.getText().toString()).replaceAll(" ","");
                Pattern p = Pattern.compile("^[a-zA-Z]\\w+");
                Matcher m = p.matcher(escreve);
                if(m.find() && m.group().length() == escreve.length()) {
                    insert       (escreve);
                    abrebanco2   (escreve);
                    iniciartabela(escreve);
                    fechabanco();
                    Intent intent = new Intent(adcionartabela.this,gerenciar2.class);
                    intent.putExtra("pagina", page2);
                    intent.putExtra("tabbanco", tabbancos);
                    startActivity(intent);
                    adcionartabela.this.finish();
                }
                else {
                    AlertDialog.Builder mensagem = 
                            new AlertDialog.Builder(adcionartabela.this);
                    mensagem.setTitle("Atenção!");
                    mensagem.setMessage("Nome inválido, não inicie com caracter numérico, use somente letras e números, não utilize espaços.");
                    mensagem.setNeutralButton("Ok",new DialogInterface.OnClickListener() {
                        public void onClick(DialogInterface dialog,int id) {
                        }});
                    mensagem.show();
                }
            }
        });
Vlw Math