Find: [
^( *)(.*)(\S+) *\{$]Replace: [
\1\2\3\n\1{]In order to differentiate between Java code and JavaScript/ActionScript code I have defined for myself, that in Java the opening curly bracket should be at the end of the line where it starts, like this:
if (true) {
System.out.println("true");
}And in JavaScript/ActionScript code it should be alone in the next line, like this:
if (true)
{
System.out.println("true");
}The above code I am using in Eclipse to replace all such instances in the JavaScript/ActionScript code which does not conform to this rule.