Why doesn\'t the following change the text for me in Android?
String content = \"test\\n=test=\\ntest\"; content = content.replaceAll(\"^=(.+)=$\", \"
Your original regex works fine if you turn on multiline mode, using (?m):
(?m)
content = content.replaceAll("(?m)^=(.+)=$", "$1");
Now ^ and $ do indeed match at line boundaries.
^
$