From ca1720729ce991ab04064ad3723d4189bbfbf72b Mon Sep 17 00:00:00 2001 From: Tino Mueller Date: Thu, 4 Apr 2024 10:14:21 +0200 Subject: [PATCH] fix too greedy regular expression --- lib/puppet-syntax/hiera.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/puppet-syntax/hiera.rb b/lib/puppet-syntax/hiera.rb index 2a8fdfe..d96f43d 100644 --- a/lib/puppet-syntax/hiera.rb +++ b/lib/puppet-syntax/hiera.rb @@ -122,7 +122,7 @@ def check(filelist) # You can do string concatenation outside of {}: # "%{lookup('this_is_ok')}:3306" def check_broken_function_call(element) - 'string after a function call but before `}` in the value' if element.is_a?(String) && /%{.+\('.*'\).+}/.match?(element) + 'string after a function call but before `}` in the value' if element.is_a?(String) && /%{[^}]+\('[^}]*'\)[^}\s]+}/.match?(element) end # gets a hash or array, returns all keys + values as array