Replace carets with HTML superscript markup using Java April 15, 2024 by Tarik str.replaceAll("\\^([0-9]+)", "<sup>$1</sup>");