Ajudaram bastante
muito obrigado
eu achei o seguinte na biblioteca de classes:
"A typical invocation sequence is thus
Pattern p = Pattern.compile("a*b");
Matcher m = p.matcher("aaaaab");
boolean b = m.matches();
A matches method is defined by this class as a convenience for when a regular expression is used just once. This method compiles an expression and matches an input sequence against it in a single invocation. The statement
boolean b = Pattern.matches("a*b", "aaaaab");
is equivalent to the three statements above, though for repeated matches it is less efficient since it does not allow the compiled pattern to be reused. "
copiando o código do meu programa, eu fiz desse jeito:
String cmd = ScanV2.proxLinha();
//ScanV2 é uma classe que eu criei.. enfim ela retorna uma string
if (Pattern.matches("[g][e][t][(](\d)+[,](\d)+[)]",cmd))
{
//faz um determinado comando se cmd for igual a "get(c,r)"
//onde "c" e "r" são um conjunto de qualquer tamanho de dígitos entre 0 e 9
}
// funciona muito bem =D
só usei isso
[abc] : procura um caracter, e apenas um, que seja ‘a’,‘b’ ou ‘c’
(\d) : procura um dígito entre 0 e 9
(\d)+ : procura um ou mais dígitos entre 0 e 9
obrigado mais uma vez =]