[問題] 搜尋tag的問題
看板RegExp (正規表示式 Regular Expression)作者threesecond (0.3秒)時間15年前 (2009/11/10 00:06)推噓1(1推 0噓 1→)留言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
11/10 04:34, 1F
→
11/10 11:00, , 2F
11/10 11:00, 2F
RegExp 近期熱門文章
PTT數位生活區 即時熱門文章