The replacement here is to use Java’s regular expression, and Java’s regular expression is very messed up. The underscore in the regular expression must be escaped with a backslash. In Java, the backslash is a special character and must also be escaped. That’s why there are two backslashes
The replacement here is to use Java’s regular expression, and Java’s regular expression is very messed up. The underscore in the regular expression must be escaped with a backslash. In Java, the backslash is a special character and must also be escaped. That’s why there are two backslashes
Java replaceAll split and the like use regular expressions by default
For solutions without escaping, please refer to my previous answer:
https://segmentfault.com/q/10...
You can do it directly, I just replaced it directly