剛剛遇到了我的正則表達式的一個問題。我想匹配方括號標記內的所有內容。正則表達式匹配所有字符和新行?
這裏是我的正則表達式:/(?:\[.*])(.*)(?:\[\/.*])/
我運行它針對此內容:
[TITLE]More Things[/TITLE]
[BODY]This is not working
still not working
nope, hasn't magically started working
I'd like to match double carriage returns[/BODY]
它只會在瞬間匹配單行標籤。任何幫助表示讚賞,謝謝。
你有嵌套的標籤?你是否也想嵌套標記文本? –
不,我永遠不會在這個系統中使用嵌套標籤。 – ToXic73