Hi,guys 我需要正则替换http { body } 的body。 下面是我的正则表达式。
http {
include mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /usr/local/etc/nginx/logs/access.log main;
sendfile on;
keepalive_timeout 65;
index index.html index.php;
include /usr/local/etc/nginx/sites-enabled/*;
}
replaced=re.sub('http\s+\{([\w\W]*)\}',"http \1",config_data)
为什么1获取不到内容呢?