$re = '/"\$name":\s"car.*_LOD_\s*\.*(?s)(.*)normal_map",\n\s*"\$type":\s"::bool",\n\s*"\$value":\s(false)/';
$str = ' },
{
"$name": "car_Dodge_Viper_ACR_LOD_red",
"$type": "@tts::editor::MaterialEntity",
"$params": {
"lightmapSpecificParams": {
"shadowColor": {
"$isSet": false,
"$hasValue": false
},
"normalMap": {
"$isSet": false,
"$hasValue": false
},
"transparencyMap": {
"$isSet": false,
"$hasValue": false
},
"diffuseMapOverride": {
"$isSet": false,
"$hasValue": false
},
"diffuseColorOverride": {
"$isSet": false,
"$hasValue": false
},
"normalMapUVChannelIdx": 1,
"diffuseMapUVChannelIdx": 1,
"emissiveMultiplier": 1.0,
"singleSided": false
},
"metashaderRef": {
"is_initialized": true,
"value": "resources/shaders/carpaint.jshader"
},
"features": [
{
"$name": "albedo_map",
"$type": "::bool",
"$value": true
},
{
"$name": "normal_map",
"$type": "::bool",
"$value": false
},
{
"$name": "roughness_map",
"$type": "::bool",
"$value": true
},
{
"$name": "occlusion_map",
"$type": "::bool",
"$value": true
},
{
"$name": "metalness_map",
"$type": "::bool",
"$value": true
},
{
"$name": "tint_map",
"$type": "::bool",
"$value": true
},';
preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0);
// Print the entire match result
var_dump($matches);
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for PHP, please visit: http://php.net/manual/en/ref.pcre.php