Given the following contents in the smb.conf file. How to remove the [share_11999] section using boost(perl version) regex. The problem is the section [share_11999] can be at the end of the file.
The following regex almost works except that it removes the "[" of the next section.
"[[a-zA-Z0-9_-]+?][^\[]+?path = /store/11999.*?(\'|\[)"
[share_11920]
path = /store/11920
writeable = yes
create mask = 0755
[share_11999]
path = /store/11999
writeable = yes
create mask = 0755
[share_12435]
path = /store/12435
writeable = yes
create mask = 0755
Basically the problem is to match anything until a character except the character or the end of the buffer.