File:
My code:
public static void main(String[] args){
//Supondo que o readLine() esteja no loop != null
String arquivoLinha = arquivo.readLine();
Pattern padrao = Pattern.compile(arquivoLinha); //O problema está aqui
Matcher texto = padrao.matcher("http://minhapagina.php?id=");
while (texto.find()){
System.out.println(texto.group());
}
}
When the last line arrives in the variable file Row ( link ), what I did not want to happen happened: The metacharacter "?" has power, thus modifying my research. I could even use the "\" escaper to ignore the "?", But how do I do that? Or at least ignore any metacharacters that are in the String file variable and consider it as literal.
I tried to do this:
Pattern.compile("["+"("+arquivoLinha+")"+"]");
Using the line inside the group, that within the list to ignore the metacharacters, but that is not working very well.