BBEdit文本筛选器-按1递增值
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了BBEdit文本筛选器-按1递增值相关的知识,希望对你有一定的参考价值。
Text filter to increment numbers by one with regex in BBEdit (Mac only)
#!/usr/bin/perl -w # 1. Copy this to a new file in BBEdit (bottom bar of the file window) # 2. Choose Unix (LF) for line endings # 3. Save it to ~/Library/Application Support/BBEdit/Text Filters/ # 4. Relaunch BBEdit # 5. Invoke the script in "Text > apply text filter >" menu # 6. Presto! while(<>) { my $line = $_; # If you wish, you can personalize you regex by change the patterns... # ...between "s/" and "/ge" in the next line. # The slash in the middle divides the search and replace patterns. # The "e" part executes the replace as Perl code... # ...incrementing the value of the former number by one. $line =~ s/(d+)/($1 + 1)/ge; }
以上是关于BBEdit文本筛选器-按1递增值的主要内容,如果未能解决你的问题,请参考以下文章
如何通过命令行实用程序操作文本:grep、cut、awk、sed 或 BBEdit(Grep 查找选项)