I have a regex defined in Python/Ruby/PHP that is like this
\"(forumdisplay.php\\?.*page=%CURRENTPAGE%)\"
When I do it for Java, I have to
Try this online tool out https://www.regexplanet.com/advanced/java/index.html
It takes your normal regular expression and outputs the Java-compatible string expression. Saved me tons of time converting huge regex strings myself.
Note that not all regex expressions work in java. I've seen weird PHP validation regex that simply behaves differently in java pattern matching.