Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use regular expressions to automatically add sql quotation marks in notepad++

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article is about how to use regular expressions to add sql quotes automatically in notepad++. Xiaobian thinks it is quite practical, so share it with everyone for reference. Let's follow Xiaobian and have a look.

notepad regular expressions add sql quotes

General sql statements are often used to add quotation marks to the contents of parentheses. sql is as follows

Select * From Test Where Id In ('25001510153394032', '25001510153394034', '25001510153393963', '25001510153392080', '25001510153392079', '25001510153393964');

At first, I referred to a method that I didn't think was very good to use. After a bit of research, it should be possible to implement regular expressions.

Let's see how notepad++ automatically adds quotes.

Step 1:

First enter the following data format (usually copy and paste it), remember to delete the blank line oh, otherwise there will be an extra line (single) double quotation marks.

25001510153394032

25001510153394034

25001510153393963

25001510153392080

25001510153392079

25001510153393964

In notepad++ menu bar macro, click Start Record, then press Ctrl+f, switch to the Replace tab, select the regular expression, enter ^in the Replace target, replace with what you want to replace (I entered 'here), then click Replace All, replace the beginning and then replace the end, enter ¥ in the Replace target, replace with what you want to replace (I entered' here), and then click Replace All. Go back to macro, click stop recording, then save macro, set shortcut key, enter the name of macro (usually named with function), save. Later you can use this shortcut key to complete the automatic quotation marks added function.

Screenshots are as follows:

The final effect is as follows:

Thank you for reading! About "Notepad++ how to use regular expressions to automatically add sql quotes" This article is shared here, I hope the above content can be of some help to everyone, so that everyone can learn more knowledge, if you think the article is good, you can share it to let more people see it!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report