I have some html codes saved in a file. I want to replace all texts that match this pattern: @@[\w]{1,}@@. but why this pattern in my java code doesn't work? is my pattern wrong?
String line = "\t<title>@@title@@</title>";
if(line.matches("@@title@@")) {
line = line.replaceAll("@@title@@", "Title");
}