[問題] 搜尋tag的問題

看板RegExp (正規表示式 Regular Expression)作者 (0.3秒)時間15年前 (2009/11/10 00:06), 編輯推噓1(101)
留言2則, 2人參與, 最新討論串1/1
我用 sisulizer 做某軟體中文化,資源是 .txt 檔案, 格式近似於XML,部份內容如下: [image]<01>../res/banner.png[/image] [bold]<01> Selecting An Operation [/bold] [image]<02>../res/line.png[/image] [body]<02> You may select an operation by using the action panel, toolbar, and menu bar or in the main operating zone. In the main operating zone, there are three options: [/body] 我要在 sisulizer 裡面設定起始字串和結束字串, 分別是 [test]text[/test], 現在光是起始字串就過濾不出來,我試了兩種方法: 1. \[[a-zA-Z]\] 搜尋到0個結果。 2. \[[^/].*[^\]]\] 可以搜尋到,但會連第一行 [image]<01>../res/banner.png[/image] 也被搜尋到,似乎沒有照我想要的排除 [/ 的tag。 搜尋結束字串的方式跟上面一樣,只是加上了/, 結果一樣失敗,有沒有高手可以幫我看看哪邊出了問題? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 219.86.171.25

11/10 04:34, , 1F
都知道 .* 了那何不試試 [a-zA-Z]*
11/10 04:34, 1F

11/10 11:00, , 2F
真是千金難買早知道啊~感謝樓上強者!
11/10 11:00, 2F
文章代碼(AID): #1A-3uNSU (RegExp)
文章代碼(AID): #1A-3uNSU (RegExp)