我的正则表达式有问题。我正在尝试将包含单词“RewriteBase”的文件中的所有行与之前可能的空格进行匹配。示例文件是:
#RewriteBase /yardley/development
RewriteBase /yardley/
我的模式及其结果:
@RewriteBase\s*(.*)@ //matches both lines - OK
@RewriteBase\s*(.*)$@ //matches first line only - why?
@^.*RewriteBase\s*(.*)@ //doesn't match any - why? It should accept all characters before "RewriteBase"
我完全坚持下去了。非常感谢