[英]Using regex to find block containing a certain word
I'm trying to find blocks like these using regex. 我正在尝试使用正则表达式查找类似这些的块。 An example of the code I'm trying to find is shown bellow, 下面显示了我要查找的代码示例,
entity //This is what I want to select
{
"id" "2"
"classname" "light" //This is what it should contain
"_light" "255 255 255 200"
"_lightHDR" "-1 -1 -1 1"
"_lightscaleHDR" "1"
"_quadratic_attn" "1"
"origin" "-128 0 -128"
editor
{
"color" "220 30 220"
"visgroupshown" "1"
"visgroupautoshown" "1"
"logicalpos" "[0 0]"
}
}
How would I go forward finding this block? 我将如何继续寻找这个障碍? Blocks not containing "classname" "light" should not be selected. 不应选择不包含“ classname”“ light”的块。 Can anyone help me out? 谁能帮我吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.