如果我有以下文字使用此命令的preg_match下一行問題
preg_replace('/[^#|^ ]Hello.*/m', 'Hello Again', $content);
#Welcome to the world of Hello World Again
#Hello World Again
Hello World Again
#Other Stuff
Other
林
我的輸出一直給我
#Welcome to the world of Hello World Again
#Hello World AgainHello Again
#Other Stuff
Other
我想是
#Welcome to the world of Hello World Again
#Hello World Again
Hello Again
#Other Stuff
Other
任何想法爲什麼這是,感謝您的幫助
忽略'#' – 2010-11-11 20:49:41
@ Angel.King.47怎麼樣,您不必忽略'#'。 '^'將表達式錨定在字符串的左側。這意味着它只會匹配以「Hello」開頭的行。 – 2010-11-11 20:51:06
謝謝你的工作 – 2010-11-11 20:52:37