사이에 모든 것을 삭제/일치PHP 정규식이 두 단어 내가 #xyzbegin과 #xyzend 사이의 모든 것을 삭제할
#xyzbegin
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase/
RewriteCond %{REQUEST_METHOD} !POST
RewriteCond %{QUERY_STRING} !.*=.*
RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$
RewriteCond %{DOCUMENT_ROOT}/wp-content/xyz-cache/$1/index.html -f
RewriteRule ^(.*) "/wp-content/xyz-cache/$1/index.html" [L]
</IfModule>
#xyzend
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
내 정규식은 다음과 같습니다
'/#xyzbegin(.*)#xyzend/m'
내가 너무이 시도 :
'/^#xyzbegin(.*)#xyzend$/m'
둘 다 작동하지 않습니다. 도와주세요.
'(? <= # xyzbegin) (. *?) (? = # xyzend)'? – ndn
파일의 다른 모든 내용을 일치시키고 삭제하는 중 –
어떻게 그렇게됩니까? 우리에게 예제 파일을 줄 수 있습니까? – ndn