【发布时间】:2012-01-04 17:15:59
【问题描述】:
如何使用 Perl 正则表达式从“abc”中提取 abc?
我试过了
echo "'abc'" | perl -ne 'if(/\'(.*)\'/) {print $1}'
但它显示:
-bash: 意外标记 `(' 附近的语法错误
【问题讨论】:
-
更多解决方案在这里发布perl-one-liner-with-single-quote
-
@jchips12 - 我喜欢
\047的解决方案