如何在变量标签文本后包含文本
How to include text after a variable tag text
我需要包括以下内容:
include="shared_actions" 代码类似于:
<View id="music_album_tracks">
<Attributes>
<Table key="track_01">
<Pair key="icon"><String>/dev_hdd0/game/PROTOOLBX/USRDIR/TOOLBOX/extras/online_music/images/black_track.png</String></Pair>
<Pair key="title"><String>01. Main Theme</String></Pair>
<Pair key="info"><String>Black™ - OST</String></Pair>
<Pair key="module_name"><String>webbrowser_plugin</String></Pair>
<Pair key="module_action"><String>http://dl.dropboxusercontent.com/s/1ip0ixd9zgab1bx/Black_-_01._Main_Theme.m4a</String></Pair>
<Pair key="bar_action"><String>none</String></Pair>
<Pair key="lbl_half"><String>1</String></Pair>
</Table>
<Table key="anyname">
<Pair key="icon"><String>/dev_hdd0/game/PROTOOLBX/USRDIR/TOOLBOX/extras/online_music/images/black_track.png</String></Pair>
<Pair key="title"><String>02. Treneska Border Crossing</String></Pair>
<Pair key="info"><String>Black™ - OST</String></Pair>
<Pair key="module_name"><String>webbrowser_plugin</String></Pair>
<Pair key="module_action"><String>http://dl.dropboxusercontent.com/s/o0he1n2kx3jygk8/Black_-_02._Treneska_Border_Crossing.m4a</String></Pair>
<Pair key="bar_action"><String>none</String></Pair>
<Pair key="lbl_half"><String>1</String></Pair>
</Table>
</Attributes>
<Items>
<Query class="type:x-xmb/module-action" key="track_01" attr="track_01"/>
<Query class="type:x-xmb/module-action" key="track_02" attr="track_02"/>
</Items>
</View>
成为
<View id="music_album_tracks">
<Attributes>
<Table key="track_01" include="shared_actions">
<Pair key="icon"><String>/dev_hdd0/game/PROTOOLBX/USRDIR/TOOLBOX/extras/online_music/images/black_track.png</String></Pair>
<Pair key="title"><String>01. Main Theme</String></Pair>
<Pair key="info"><String>Black™ - OST</String></Pair>
<Pair key="module_name"><String>webbrowser_plugin</String></Pair>
<Pair key="module_action"><String>http://dl.dropboxusercontent.com/s/1ip0ixd9zgab1bx/Black_-_01._Main_Theme.m4a</String></Pair>
<Pair key="bar_action"><String>none</String></Pair>
<Pair key="lbl_half"><String>1</String></Pair>
</Table>
<Table key="anyname" include="shared_actions">
<Pair key="icon"><String>/dev_hdd0/game/PROTOOLBX/USRDIR/TOOLBOX/extras/online_music/images/black_track.png</String></Pair>
<Pair key="title"><String>02. Treneska Border Crossing</String></Pair>
<Pair key="info"><String>Black™ - OST</String></Pair>
<Pair key="module_name"><String>webbrowser_plugin</String></Pair>
<Pair key="module_action"><String>http://dl.dropboxusercontent.com/s/o0he1n2kx3jygk8/Black_-_02._Treneska_Border_Crossing.m4a</String></Pair>
<Pair key="bar_action"><String>none</String></Pair>
<Pair key="lbl_half"><String>1</String></Pair>
</Table>
</Attributes>
<Items>
<Query class="type:x-xmb/module-action" key="track_01" attr="track_01"/>
<Query class="type:x-xmb/module-action" key="track_02" attr="track_02"/>
</Items>
</View>
总结:
我需要在标记结束后包含代码 include="shared_actions" <Table key="XXXXX">
其中 XXXXX 可以是任何文本
例如:<Table key="TEST">
到
<Table key="TEST" include="shared_actions">
文本允许我 post 它,因为它说我需要添加更多详细信息
- Ctrl+H
- 查找内容:
<table key="[^"]+"
- 替换为:
[=13=] include="shared_actions"
- UNCHECK 匹配大小写
- 检查 环绕
- 检查 正则表达式
- 全部替换
解释:
<table key=" # literally
[^"]+ # 1 or more character that is not a double quote
" # double quote
替换:
[=11=] # the whole match
include="shared_actions" # note the space at the beginning
截图(之前):
截图(后):
我需要包括以下内容:
include="shared_actions" 代码类似于:
<View id="music_album_tracks">
<Attributes>
<Table key="track_01">
<Pair key="icon"><String>/dev_hdd0/game/PROTOOLBX/USRDIR/TOOLBOX/extras/online_music/images/black_track.png</String></Pair>
<Pair key="title"><String>01. Main Theme</String></Pair>
<Pair key="info"><String>Black™ - OST</String></Pair>
<Pair key="module_name"><String>webbrowser_plugin</String></Pair>
<Pair key="module_action"><String>http://dl.dropboxusercontent.com/s/1ip0ixd9zgab1bx/Black_-_01._Main_Theme.m4a</String></Pair>
<Pair key="bar_action"><String>none</String></Pair>
<Pair key="lbl_half"><String>1</String></Pair>
</Table>
<Table key="anyname">
<Pair key="icon"><String>/dev_hdd0/game/PROTOOLBX/USRDIR/TOOLBOX/extras/online_music/images/black_track.png</String></Pair>
<Pair key="title"><String>02. Treneska Border Crossing</String></Pair>
<Pair key="info"><String>Black™ - OST</String></Pair>
<Pair key="module_name"><String>webbrowser_plugin</String></Pair>
<Pair key="module_action"><String>http://dl.dropboxusercontent.com/s/o0he1n2kx3jygk8/Black_-_02._Treneska_Border_Crossing.m4a</String></Pair>
<Pair key="bar_action"><String>none</String></Pair>
<Pair key="lbl_half"><String>1</String></Pair>
</Table>
</Attributes>
<Items>
<Query class="type:x-xmb/module-action" key="track_01" attr="track_01"/>
<Query class="type:x-xmb/module-action" key="track_02" attr="track_02"/>
</Items>
</View>
成为
<View id="music_album_tracks">
<Attributes>
<Table key="track_01" include="shared_actions">
<Pair key="icon"><String>/dev_hdd0/game/PROTOOLBX/USRDIR/TOOLBOX/extras/online_music/images/black_track.png</String></Pair>
<Pair key="title"><String>01. Main Theme</String></Pair>
<Pair key="info"><String>Black™ - OST</String></Pair>
<Pair key="module_name"><String>webbrowser_plugin</String></Pair>
<Pair key="module_action"><String>http://dl.dropboxusercontent.com/s/1ip0ixd9zgab1bx/Black_-_01._Main_Theme.m4a</String></Pair>
<Pair key="bar_action"><String>none</String></Pair>
<Pair key="lbl_half"><String>1</String></Pair>
</Table>
<Table key="anyname" include="shared_actions">
<Pair key="icon"><String>/dev_hdd0/game/PROTOOLBX/USRDIR/TOOLBOX/extras/online_music/images/black_track.png</String></Pair>
<Pair key="title"><String>02. Treneska Border Crossing</String></Pair>
<Pair key="info"><String>Black™ - OST</String></Pair>
<Pair key="module_name"><String>webbrowser_plugin</String></Pair>
<Pair key="module_action"><String>http://dl.dropboxusercontent.com/s/o0he1n2kx3jygk8/Black_-_02._Treneska_Border_Crossing.m4a</String></Pair>
<Pair key="bar_action"><String>none</String></Pair>
<Pair key="lbl_half"><String>1</String></Pair>
</Table>
</Attributes>
<Items>
<Query class="type:x-xmb/module-action" key="track_01" attr="track_01"/>
<Query class="type:x-xmb/module-action" key="track_02" attr="track_02"/>
</Items>
</View>
总结:
我需要在标记结束后包含代码 include="shared_actions" <Table key="XXXXX">
其中 XXXXX 可以是任何文本
例如:<Table key="TEST">
到
<Table key="TEST" include="shared_actions">
文本允许我 post 它,因为它说我需要添加更多详细信息
- Ctrl+H
- 查找内容:
<table key="[^"]+"
- 替换为:
[=13=] include="shared_actions"
- UNCHECK 匹配大小写
- 检查 环绕
- 检查 正则表达式
- 全部替换
解释:
<table key=" # literally
[^"]+ # 1 or more character that is not a double quote
" # double quote
替换:
[=11=] # the whole match
include="shared_actions" # note the space at the beginning
截图(之前):
截图(后):