作者threesecond (0.3秒)
看板RegExp
標題[問題] 搜尋tag的問題
時間Tue Nov 10 00:06:44 2009
我用 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
1F:推 LPH66:都知道 .* 了那何不試試 [a-zA-Z]* 11/10 04:34
2F:→ threesecond:真是千金難買早知道啊~感謝樓上強者! 11/10 11:00