I want to replace (words that starts with letter 'a' has one or more chars and ends with 'a') with sign '!' and print it, but nothing is working. Why?
class Test
{
public static void main(String[] args)
{
String s = "aba accca azzza wwwwa";
System.out.println(s = s.replaceAll("\ba.+?a\b", "!"));
}
}
Current ouput: aba accca azzza wwwwa
Desired ouput: ! ! ! wwwwa