Last active
June 19, 2019 00:24
-
-
Save tedyoung/d344fb9d89597943de54de0e92041164 to your computer and use it in GitHub Desktop.
replaceAll using DOTALL mode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String text = | |
"```\n" + | |
"public class Stock {\n" + | |
"\n" + | |
"}\n" + | |
"```\n"; | |
text = text.replaceAll("(?s)```(.*?)```", "<pre>$1</pre>"); | |
System.out.println(text); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment