Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Regex 在OSX中自动化正则表达式_Regex_Macos_Markdown_Automator - Fatal编程技术网

Regex 在OSX中自动化正则表达式

Regex 在OSX中自动化正则表达式,regex,macos,markdown,automator,Regex,Macos,Markdown,Automator,我经常使用TextWrangler在文件上运行正则表达式复制替换操作,我想使用OS X中的Automator自动执行此操作。例如,在下面的场景中,我从Pinboard.in获取文本输出,然后在TextEdit中运行一些正则表达式搜索/替换操作,然后保存为文件 从 在TextWranger中运行以下搜索替换(以大纲形式转换为标记链接): 查找:^\[(.*)\]\r(.*)\r 替换为:*[\2](\1)\r 然后去掉所有没有以* 查找:^[^\*].\r 替换:[留空] 我的目标是将所有

我经常使用TextWrangler在文件上运行正则表达式复制替换操作,我想使用OS X中的Automator自动执行此操作。例如,在下面的场景中,我从Pinboard.in获取文本输出,然后在TextEdit中运行一些正则表达式搜索/替换操作,然后保存为文件

  • 在TextWranger中运行以下搜索替换(以大纲形式转换为标记链接):
    • 查找:
      ^\[(.*)\]\r(.*)\r
    • 替换为:
      *[\2](\1)\r
  • 然后去掉所有没有以
    *
    • 查找:
      ^[^\*].\r
    • 替换:[留空]
  • 我的目标是将所有这些保存为脚本,可以在钉板URL上运行并保存为文件。有什么想法吗?谢谢