Notepad regular expression Add SQL quotes, please read the details below.
General SQL statements often use quotes in parentheses to add the following SQL
Select * from
Test
Where Id in (' 25001510153394032 ',
' 25001510153394034 ', '
25001510153393963
', ' 25001510153392080 ',
' 25001510153392079 ', '
25001510153393964 ');
I started by referring to the Http://www.jb51.net/article/73608.htm method, which I found to be less useful. In the study, it should be possible to use regular expressions to implement.
Let's see how to get notepad++ to automatically add quotes.
Step 1,
First input the following data format (usually copy and paste it), remember to delete the blank line Oh, otherwise there will be a line (single) double quotes.
25001510153394032
25001510153394034
25001510153393963
25001510153392080
25001510153392079
25001510153393964
At the macro at the notepad++ menu bar, click Start Recording, then press CTRL+F, switch to the Replacement tab, select Regular expression, and enter ^ at the replacement target. Replace with replace with the content you want to replace (I entered here is '), then replace all the points, replace the end after the beginning, replace the ending, enter the ¥ at the replacement target, replace the replacement with the content you want to replace (I entered here is ',), and then click Replace All. Back to the macro, click Stop Recording, then save the macro, set the shortcut key, enter the name of the macro (generally named after the function), save. You can then use this shortcut to complete this automatic quote-adding function.
Screenshot below:
The final effect is as follows:
Summary: Like this neatly formatted data, priority thinking is handled with regular expressions and is not limited to notepad++, which supports macros, and regular expressions can be used.