Skip to content

Commit e779d12

Browse files
author
Rob Braden
committed
Update settings regexes to support settings with "[", "]" in them
1 parent ae23a4d commit e779d12

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/puppet/util/ini_file.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ module Util
66
class IniFile
77

88
@@SECTION_REGEX = /^\s*\[([\w\d\.\\\/\-\:\s]*[\w\d\.\\\/\-])\]\s*$/
9-
@@SETTING_REGEX = /^(\s*)([\w\d\.\\\/\-\s]*[\w\d\.\\\/\-])([ \t]*=[ \t]*)([\S\s]*?)\s*$/
10-
@@COMMENTED_SETTING_REGEX = /^(\s*)[#;]+(\s*)([\w\d\.\\\/\-]+)([ \t]*=[ \t]*)([\S\s]*?)\s*$/
9+
@@SETTING_REGEX = /^(\s*)([^\[#;]*[\w\d\.\\\/\-\s\[\]\']*[\w\d\.\\\/\-\]])([ \t]*=[ \t]*)([\S\s]*?)\s*$/
10+
@@COMMENTED_SETTING_REGEX = /^(\s*)[#;]+(\s*)([^\[]*[\w\d\.\\\/\-]+[\w\d\.\\\/\-\[\]\']+)([ \t]*=[ \t]*)([\S\s]*?)\s*$/
1111

1212
def initialize(path, key_val_separator = ' = ')
1313
@path = path

0 commit comments

Comments
 (0)