Notepad ++ strip bbcode颜色语句

时间:2010-08-21 02:33:19

标签: regex

以下是我的文本文件:

    [img]asset:/052cf103006dc0a1aee06067b12b2153-40[/img] Adrik Thorgrim: [color=#000000]done for the night then?[/color]
GM: [color=#000000]Yes[/color]
[img]asset:/052cf103006dc0a1aee06067b12b2153-40[/img] Adrik Thorgrim: [color=#000000]I would prolly plan on altruis notshowing up[/color]
[img]asset:/052cf103006dc0a1aee06067b12b2153-40[/img] Adrik Thorgrim: [color=#000000]i've known both of em for 10 or soyears[/color]
[img]asset:/052cf103006dc0a1aee06067b12b2153-40[/img] Adrik Thorgrim: [color=#000000]tycho is without power tonight[/color]
[img]asset:/052cf103006dc0a1aee06067b12b2153-40[/img] Adrik Thorgrim: [color=#000000]he lives in the middle of farm country[/color]
[img]asset:/052cf103006dc0a1aee06067b12b2153-40[/img] Adrik Thorgrim: [color=#000000]on a dirt road off a dirt road[/color]
[img]asset:/052cf103006dc0a1aee06067b12b2153-40[/img] Adrik Thorgrim: [color=#000000]I went through the massive ice stormback in the 90s that ruined New England's power system, I know allabout it[/color]
[img]asset:/052cf103006dc0a1aee06067b12b2153-40[/img] Adrik Thorgrim: [color=#000000]your at 424.42[/color]
[img]asset:/052cf103006dc0a1aee06067b12b2153-40[/img] Adrik Thorgrim: [color=#000000]I'll send you a statblock for Ciro myenchanter tomorrow[/color]
[img]asset:/052cf103006dc0a1aee06067b12b2153-40[/img] Adrik Thorgrim: [color=#000000]I struggled with Kazac[/color]
[img]asset:/052cf103006dc0a1aee06067b12b2153-40[/img] Adrik Thorgrim: [color=#000000]er not enchanter air wizard...[/color]
[img]asset:/052cf103006dc0a1aee06067b12b2153-40[/img] Adrik Thorgrim: [color=#000000]its fun[/color]
[img]asset:/052cf103006dc0a1aee06067b12b2153-40[/img] Adrik Thorgrim: [color=#000000]I actually been pretty excited forthis AP[/color]
[img]asset:/052cf103006dc0a1aee06067b12b2153-40[/img] Adrik Thorgrim: [color=#000000]I'll do a nice photoshop map of outkingdom when we get there[/color]
[img]asset:/052cf103006dc0a1aee06067b12b2153-40[/img] Adrik Thorgrim: [color=#000000]Im a decent cartographer[/color]
GM: [color=#000000]This AP is really kick ass when yousit down and read it. Although, if you have player's like my RotRLgames on Fridays, this game would suck.[/color]
[img]asset:/052cf103006dc0a1aee06067b12b2153-40[/img] Adrik Thorgrim: [color=#000000]I am the most generalist char statwise here[/color]
GM: [color=#000000]All of the different roles are on thewiki for you guys to decide what you think would best benefit youand the party.[/color]
Valens: [color=#000099]REally? 14, 14, 12, 12, 16, 12[/color]
[img]asset:/052cf103006dc0a1aee06067b12b2153-40[/img] Adrik Thorgrim: [color=#000000]12,16,14,12,14,12[/color]
Valens: [color=#000099]LOL[/color]
[img]asset:/052cf103006dc0a1aee06067b12b2153-40[/img] Adrik Thorgrim: [color=#000000]nope[/color]
[img]asset:/052cf103006dc0a1aee06067b12b2153-40[/img] Adrik Thorgrim: [color=#000000]i'll add it to my watch instantly[/color]
[img]asset:/052cf103006dc0a1aee06067b12b2153-40[/img] Adrik Thorgrim: [color=#000000]ps3[/color]
[img]asset:/052cf103006dc0a1aee06067b12b2153-40[/img] Adrik Thorgrim: [color=#000000]and wii[/color]
[img]asset:/052cf103006dc0a1aee06067b12b2153-40[/img] Adrik Thorgrim: [color=#000000]ps3 just got the search feature[/color]
[img]asset:/052cf103006dc0a1aee06067b12b2153-40[/img] Adrik Thorgrim: [color=#000000]if we have to find some people toreplace im fine with that[/color]
GM: [color=#000000]Plus, NetFlix just signed a deal withShowtime and Epix[/color]
[img]asset:/052cf103006dc0a1aee06067b12b2153-40[/img] Adrik Thorgrim: [color=#000000]yea[/color]
[img]asset:/052cf103006dc0a1aee06067b12b2153-40[/img] Adrik Thorgrim: [color=#000000]paramount and lion's gate moviesstarting sept 1st[/color]
Valens: [color=#000099]Goodnight. Having fun. TOo bad Jaycouldn't join us...[/color]
GM: [color=#000000]Yeah, I will post again on the TangledWeb site and RPTools[/color]
[i][color=#0000ff]mdh is disconnected.[/color][/i]
[img]asset:/052cf103006dc0a1aee06067b12b2153-40[/img] Adrik Thorgrim: [color=#000000]might be worth asking jay again, mighthave cooled down for him its, been about 3-4 weeks[/color]
[img]asset:/052cf103006dc0a1aee06067b12b2153-40[/img] Adrik Thorgrim: [color=#000000]goodnight see you sat[/color]

我尝试使用的RegEx不起作用:

[color \ =#000000]([A-Za-z0-9,。<>?:“;'{} [] -_ = +!@#$%^& *()] +)[/色]

我想要做的是从每一行中删除[color =#000000]和[/ color],并保留文本和[img] [/ img]。

2 个答案:

答案 0 :(得分:0)

嗯......如何使用'Find& amp;取代所有[color=#000000][/color]。全部替换'(每个关键字一次)?不需要那样混乱正则表达式;)

答案 1 :(得分:0)

如果您只想删除#000000颜色,那么我同意Lukman:使用Find& amp; amp; amp;全部替换。

我在该块中看到了其他颜色的实例,因此我假设您要替换所有颜色,而不仅仅是#000000。如果是这样,那么使用正则表达式Find&全部替换为\[color=#\d*]的模式,而不是[color=#000000]字符串。