I have a yaml template with content like that:
Example 1:
- key: MY_KEY
value: "{{ $MY_VAL }}"
Example 2:
- key: MY_KEY
value: "$MY_VAL"
Example 3:
- key: MY_KEY
value: '$MY_VAL'
Example 4:
- key: MY_KEY
value: 'MY_VAL'
I want to match with regex MY_VAL incase of MY_KEY with new line (\r\n) then MY_VAL, but just incase it's not any kind of variable and it's a real value (e.g alphanumeric).
In the above Example 1 & Example 2 & Example 3 => I want it will return no match.
In Example 4 I want it will return there is a match.
I tried this regex with no success (IMHO I thought it will work, but it's not):
MY_KEY[\r\n]+[^${}].[\w].([^\r\n]+)
I follow that question of multiline regex, but it's not help in this case:
https://stackoverflow.com/a/37526464
Please help :D