Replace Help
-
Hi guys,
I am trying to replace
That
Hint “Any Text Here”
With
[“Any text Here”] spawn life_fnc_hintThe Any text here, is not the text that i want, Its like that
https://i.imgur.com/ZGJf93q.png
I have a lot of work to do if anyone found the way to do it :)
https://i.imgur.com/WOlws9w.png
Can anybody try to help me?
Thank you in advance.
-
Hello, @bortfive,
-
First, I strongly advice you to backup your
271files ! -
Then, test my regex search/replacement, below, on
onefile, only !
-
Copy **one of your files in a new tab (
Ctrl + N) -
Open the Replace dialog (
Ctrl + H) -
Type in the regex
(?-is)^hint (".+?");, in the Find what: zone -
Type in the regex
[\1] spawn life_fnc_hint, in the Replace with: zone -
Tick the
Wrap aroundoption -
Click on the
Replace Allbutton
Et voilà !
Note that, only, all ranges
hint ".......";, beginning the lines, are matched !So, given the initial text, below :
hint "Ahora ves los nombres de los jugadores"; hint "This is a test !"; hint " Has dejado de ver los nombres de los jugadores ";You should obtain :
["Ahora ves los nombres de los jugadores"] spawn life_fnc_hint hint "This is a test !"; [" Has dejado de ver los nombres de los jugadores "] spawn life_fnc_hintNow, if you may have several zones
hint ".......";, in a same line, change the search regex to :(?-is)hint (".+?");And, you’ll get the following text :
["Ahora ves los nombres de los jugadores"] spawn life_fnc_hint ["This is a test !"] spawn life_fnc_hint [" Has dejado de ver los nombres de los jugadores "] spawn life_fnc_hintNotes :
-
First, the
(?-is)modifiers :-
Force the regex engine to consider any dot as matching one single standard character ( and not the EOL ones )
-
Force the search to be sensitive to case ( => So, a line
HINT "....";orHint "....";is not matched ! )
-
-
The part
.+?represents the shorter range of characters between the two boundaries" -
As this range
"....."is surrounded by parentheses, it is stored as group 1 -
In replacement, the
\1syntax stands for the group 1 contents
Best Regards,
guy038
-
-
@guy038 i will try it, u are the best bro <3
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