Replace symbols around a word
-
I’m trying to replace a lot of lines that would otherwise take so much time.
From:
[[Wood]] [[Unit|units]]To:
{{LT2|Wood}} {{LT2|Unit|units}}Any ideas?
-
-
Hello, @blake-kline, @alan-kilborn and All,
@blake-kline, if the text shown in your post, just represents the present and future text, the following regex S/R should modify your text as expected !
-
SEARCH
(?x-i) \x5B\x5B ( Wood ) \x5D \x5D \x20 \x5B\x5B ( Unit \| units ) \x5D\x5D -
REPLACE
{{LT2|\1}} {{LT2|\2}}
Best Regards,
guy038
-
-
@guy038
I’m not sure if I’m missing something, but if the text OP provided is exactly the text that should be changed, wouldn’t that be the obvious solution:find:
[[Wood]] [[Unit|units]]
replace:{{LT2|Wood}} {{LT2|Unit|units}}No regex is needed at all.
-
@Ekopalypse said in Replace symbols around a word:
No regex is needed at all.
Well, that’s the reason I suspected the OP just hasn’t asked their true question, and thus why I directed them to information on how they should ask their question.
-
@Alan-Kilborn
That’s how I interpreted it, yes, but OP upgraded @guy038’s response, so we both seem to have missed something Guy (?) understood. OP seems happy - that’s what matters. -
@Ekopalypse said in Replace symbols around a word:
That’s how I interpreted it, yes, but OP upgraded @guy038’s response, so we both seem to have missed something Guy (?) understood.
And oddly, when I was thinking up my reply in case it was needed (and it obviously wasn’t), mine was going to be even more generic than Guy’s answer, replacing anything between double-brackets with double-braces-and-LT2 (and wasn’t restricted to always two-to-a-line). So I was surprised when the OP seemed to be happy with Guy’s less-generic expression.
This is why it’s better the more details a person includes in their original question, because there were at least three reasonable (but incompatible) interpretations of the original question in this case. And it’s such vagueness that gives the Search-and-Replace-Question-Template a reason to exist.
-
@PeterJones said in Replace symbols around a word:
This is why it’s better the more details a person includes in their original question…
I couldn’t agree more.
-
Replacing symbols is very simple if you use Facebook symbols. I learned a lot from this website, which has a great article on each symbol. You can convert your whole article into a symbol if you have knowledge about it.
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