您如何评论Perl正则表达式? [英] How do you comment a Perl regular expression?
本文介绍了您如何评论Perl正则表达式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在Perl正则表达式中添加注释?
How do you put comments inside a Perl regular expression?
推荐答案
使用/x修饰符:
my $foo = "zombies are the bombies";
if ($foo =~ /
zombie # sorry pirates
/x ) {
print "urg. brains.\n";
}
Also see the first question in perlfaq6.
在阅读过程中阅读所有 perlre 也不会有什么害处
Also it wouldn't hurt to read all of perlre while you're at it.
这篇关于您如何评论Perl正则表达式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文