当前位置:网站首页>正则表达式行尾行首添加字符
正则表达式行尾行首添加字符
2022-08-06 04:13:00 【我不知道也不关心】
有时候拿到一批id或手机号或姓名,需要查询数据库,但需要对拿到的数据行尾行首带上单引号和分号,如果手机号很长,需要让手机号列转行放在SQL中。这是excel熟练的同学可能就用excel搞定了,我一般用VS Code或sublime text的正则表达式批量替换功能来,3-5秒搞定。
例如下面数据,需要对行尾行首添加单引号和分号。VS Code有个好处就是写了正则,文本区有颜色提示匹配到的位置
^ 行首
$ 行尾


列转行,$ 匹配行尾,\n 换行符换成空白,windows换行符\r\n,unix mac换行符 \n 或 \r,看VS Code编辑器是否有颜色变化提示匹配到即可


边栏推荐
- Jvm: synchronized锁定谁?
- 如何搭建测试环境?搭建测试环境的步骤跟注意事项(视频教程版)
- boost::asio::async_read、boost::asio::async_write 模板函数的简化版实现逻辑。
- xctf Attack and Defense World Web Master Advanced Zone upload1
- AC8015 Notes
- 洛谷: P1057 [NOIP2008 普及组] 传球游戏
- Cloudflare CDN(泛播)支持转发的网络端口
- Practical and bytes to beat Flink status query optimization
- 十四. go channel
- 论文阅读 (65):RePaint: Inpainting using Denoising Diffusion Probabilistic Models
猜你喜欢

【Image classification】2021-CvT

程序员上班第一天 | 每日趣闻

造自己的芯,让谷歌买单!谷歌再度开源 180nm 工艺的芯片

Detailed BGP (1)

(十)集合 -Set

2018HBCPC Partial Solutions

Introduction to Elliptic Curves (4): Elliptic Curve Security, Compared with RSA

Why is the result of double = 5 / 9; zero

用户认证——Kerberos部署

"Module + antenna" full stack solution, to speed up the Internet of things terminal efficient deployment
随机推荐
gst-launch-1.0
Can HTAP replace OLAP?
1×1 问题详解
The principle and function of $nextTick
5. redux
P1404 平均数
What is an Egg. The js, it have what features, installation of an Egg framework, definition of routing, what's Controller is the Controller, CORS configuration, the json configuration, a get request,
Mysql installation ask for answers
Discrete mathematics the final problem
Which browser has fewer ads?Multi-Royal Safe Browser Light Experience
Routing policy in redistribution:
MySQL——进阶操作
[C language array subscript out of bounds] Infinite loop caused by array subscript out of bounds
线程安全的随机数
BGP详解(1)
【LaTex】 - 对齐符号&的用法,换行符\\的用法,Misplaced &错误怎么解决
论文阅读 (65):RePaint: Inpainting using Denoising Diffusion Probabilistic Models
如何搭建测试环境?搭建测试环境的步骤跟注意事项(视频教程版)
单区域——OSPF 讲解+配置命令(为了做双机热备实验)
OSPF —— cost值选路