Difference between revisions of "Search and Replace Tricks"

From EditPlus Wiki
Jump to: navigation, search
(by ElfQrin)
 
(BReak lines)
Line 1: Line 1:
 
==Delete all empty lines==
 
==Delete all empty lines==
Find: "^\n" (without quotes)
+
Find: "^\n" (without quotes)<br />
Replace: "" (without quotes)
+
Replace: "" (without quotes)<br />
RegExp
+
RegExp<br />
  
 
==Truncate last value from a MySQL query==
 
==Truncate last value from a MySQL query==
Find: (VALUES \('...', '.+'), .+\);
+
Find: (VALUES \('...', '.+'), .+\);<br />
Replace: \1);
+
Replace: \1);<br />
RegExp
+
RegExp<br />
  
 
==Keep only last value in a MySQL query==
 
==Keep only last value in a MySQL query==
Find: (VALUES \(.+,)(.+\);)
+
Find: (VALUES \(.+,)(.+\);)<br />
Replace: VALUES (\2
+
Replace: VALUES (\2<br />
RegExp
+
RegExp<br />

Revision as of 00:42, 23 June 2006

Delete all empty lines

Find: "^\n" (without quotes)
Replace: "" (without quotes)
RegExp

Truncate last value from a MySQL query

Find: (VALUES \('...', '.+'), .+\);
Replace: \1);
RegExp

Keep only last value in a MySQL query

Find: (VALUES \(.+,)(.+\);)
Replace: VALUES (\2
RegExp