import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class Example {
public static void main(String[] args) {
final String regex = "(?<=setText\\()\\\"\\\"[.\\n]*|\\\"\\\"(\\n)*(?![\\)\\}\\]])";
final String string = "hou_sticky = hou_parent.createStickyNote(\"__stickynote1\")\n"
+ "hou_sticky.setText(\"\"To use the proxys you need to do:\n\n"
+ "-bake every specific tree inside of the setup trees to a rs archive. \n"
+ "- activate the visibility flag and load the rs archive in the proxy tab of the redshift parameter tab\n"
+ "- make sure the setup trees are not visible at render time\n\n"
+ "IMPORTANT: IF you dont want to render the trees with Displacement you have to deactivate Displacement in the Redshift Parameter TAB ofevery specific Setup Tree. Then you need to bake out the redshift proxy for each tree in the Setup Tree Sop Network too.\"\")\n"
+ "hou_sticky.setTextSize(0)\n\n"
+ "hou_parm.set(\"\")\n\n"
+ "hou_node.setUserData(\"___Version___\", \"\")\n\n"
+ "hou_parm_template2 = hou.ToggleParmTemplate(\"vex_strict\", \"Enforce Prototypes\", default_value=False, default_expression='off', default_expression_language=hou.scriptLanguage.Hscript)\n"
+ "hou_parm_template2.setTags({\"autoscope\": \"0000000000000000\", \"script_callback\": \"\"})";
final String subst = "\\\"\\\"\\\"";
final Pattern pattern = Pattern.compile(regex, Pattern.MULTILINE);
final Matcher matcher = pattern.matcher(string);
// The substituted value will be contained in the result variable
final String result = matcher.replaceAll(subst);
System.out.println("Substitution result: " + result);
}
}
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Java, please visit: https://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html