str.replaceAll("\\^([0-9]+)", "<sup>$1</sup>");
More Related Contents:
- Java: splitting a comma-separated string but ignoring commas in quotes
- Split string with dot as delimiter
- Use String.split() with multiple delimiters
- Java how to replace 2 or more spaces with single space in string and delete leading and trailing spaces
- Java Regex Capturing Groups
- SCJP6 regex issue
- Get the index of a pattern in a string using regex
- Regular expression for excluding special characters [closed]
- How to determine if a number is a prime with regex?
- Java regex to extract text between tags
- Java regex: Repeating capturing groups
- Why does this Java regex cause “illegal escape character” errors?
- java.util.regex – importance of Pattern.compile()?
- Any character including newline – Java Regex
- How do I create a Stream of regex matches?
- Regex to match words of a certain length
- Java regular expression OR operator
- regex to match substring after nth occurence of pipe character
- What is the difference between `Greedy` and `Reluctant` regular expression quantifiers?
- Understanding regex in Java: split(“\t”) vs split(“\\t”) – when do they both work, and when should they be used
- How to replace ” \ ” with ” \\ ” in java
- Why doesn’t this regex work as expected in Java?
- Validate a file name on Windows
- Java split is eating my characters
- Regular expression to validate username
- Java Regex pattern that matches in any online tester but doesn’t in Eclipse
- Java Pattern Matcher: create new or reset?
- What is a regex “independent non-capturing group”?
- Java regex error – Look-behind group does not have an obvious maximum length
- Parse Date from String in this format : dd/MM/yyyy [to dd/MM/yyyy]