[英]Perl string contains bracket
I have a question. 我有个问题。 I have a variable that contains brackets for example:
我有一个包含方括号的变量,例如:
Local $string = "abc[0].xzy"
Now I want to search for all strings in a file that matches that string $string
. 现在,我想搜索文件中与该字符串
$string
匹配的所有$string
。 The problem is that the string contains a bracket and I can't change the to abc\\[0\\]\\.xzy
. 问题是该字符串包含方括号,并且我无法将其更改为
abc\\[0\\]\\.xzy
。 Is there a solution to solve my problem? 有解决我的问题的解决方案吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.