开发者

Regular expression to append a value to gitosis.conf file

开发者 https://www.devze.com 2023-03-05 20:45 出处:网络
I need help appending a value to gitosis.conf file using PHP. I\'d like开发者_如何学编程 to use regular expression to add a new user to members list. Here\'s the structure of the conf file:

I need help appending a value to gitosis.conf file using PHP. I'd like开发者_如何学编程 to use regular expression to add a new user to members list. Here's the structure of the conf file:

[group devs]
members = user1 user2

[group admins]
members = user1

[group gitosis-admin]
writable = gitosis-admin


http://www.rubular.com/r/ELSAs8RAGZ Should work, you can then easily rebuild a string using $1 and $2, you can replace the first .* (in brackets) with the name of the group you want to append to.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号