type
status
date
slug
summary
tags
category
icon
password
📌
醉眼看人间,人人都温柔,醒时看事态,事事都炎凉。

实例

将以下表中内容的字段名取出来,并添加双引号,在其他代码中复制引用

步骤1

  • 新建文件 empty,将内容复制到文件中
notion image

步骤2

  • command+r 快捷键打开查找替换功能
  • 去掉”=”后面所有内容,只保留字段名
  • 输入=.*$
    • 注:第一行输入=.*$ 表示查找等号后面所有内容;第二行不输入表示替换清空
  • 点击regular打开正则模式
  • 点击Replace All
notion image
  • 效果
notion image

步骤3

  • 删除字段前冗余空格
  • 第一行输入空格,第二行不输入
  • 点击Replace All
notion image
  • 效果
notion image

步骤3

  • 给字段添加双引号
  • 光标移动字段首位置
  • 第一行输入符号^ (表示开始位置)
  • 第二行输入” (替换为”)
  • 光标移动后字段名末位置
  • 第一行输入符号$ (表示末位置)
  • 第二行输入” (替换为”)
notion image
  • 效果
notion image

参考link

 
探索山野,寻觅野生秋果,欣赏最后的金秋风景python_高阶函数(装饰器)
  • Twikoo
  • Cusdis