Remove Repeated Words and Symbols
-
{ } =spaceI would like to replace these characters with an underscore, and then remove all the duplicate words.
For instance, I’d like to change:
dmg_sm0993_event (summonedtable) 0039-event [damage=hit_defend_fail_se_0039_type=slash_low] [damage_fail_type=defend_fail] {!} {r} {m} {s} {e}To (both “{ }” and characters inside are not needed.)
dmg_sm0993_event_summonedtable_0039_damage_hit_defend_fail_se_type_slash_low -
Hello, @kloruklass and All,
Given your ( uniq ! ) example :
dmg_sm0993_event (summonedtable) 0039-event [damage=hit_defend_fail_se_0039_type=slash_low] [damage_fail_type=defend_fail] {!} {r} {m} {s} {e}With the following regex S/R :
-
SEARCH
(?-s)[^\w{}\r\n]+(?:\x20*({.+?})|) -
REPLACE
?1:_ -
Tick the
Wrap aroundoption -
Select the
Regular expressionsearch mode -
Click once, on the
Replace Allbutton
You’ll get this temporary text :
dmg_sm0993_event_summonedtable_0039_event_damage_hit_defend_fail_se_0039_type_slash_low_damage_fail_type_defend_fail
Now, using this second regex S/R :
-
SEARCH
(?i-s)(([a-z0-9]+)_.*)_\2(?:(_)|\R|\z) -
REPLACE
\1?3_ -
Click on the
Replace Allbutton, several times, till you see the status line0 occurrences were replaced in entire file( IMPORTANT )
And you’ll get the expected text :
dmg_sm0993_event_summonedtable_0039_damage_hit_defend_fail_se_type_slash_lowBest Regards
guy038
-
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login