I would like a plugin that lets you write code in JS to Find in File
-
After concluding Regex is not real, I would like to have a plugin that asks me to write a code that looks like this:
function _find_in_file(textArray, resultsArray) { for(let i=0;i < textArray.length;i++) { let originalText = textArray[i]; let alteredText = textArray[i]; removeIdentation(alteredText ); if(alteredText.startsWith("PrintToChat(") { // The array is the text that will be matched, obviously it will require also pushing the file the text is in, and the position it's in. resultsArray.push(originalText); } continue; } }
-
I searched for 10 whole minutes, and wrote the code in 2 minutes.
The objective is after removing any indents or \n \t \0 \x
is to match for PrintToChat(…
and to not match for PrintToChatAll(…
and to not match for RP_PrintToChatBasically anti wildcard on *PrintToChat(
Unfortunately could not find “anti wild card”
-
@Eyal282 said in I would like a plugin that lets you write code in JS to Find in File:
The objective is after removing any indents or \n \t \0 \x
So, to encapsulate, you’re trying to remove
\n
(newline),\t
(tab), I get these, but\0
or\x
I don’t understand, unless you’re trying to remove a hex number\0xa0
and/or\0x0d
type of thing. For those that might be able to help, you really should elaborate EXACTLY in the style of this forum available in the FAQ’s section here for how to format and phrase, the text or symbols you want removed.Good luck.
-
@Eyal282 said in I would like a plugin that lets you write code in JS to Find in File:
Basically anti wildcard on *PrintToChat(
You don’t need “anti-wildcard”. You need “boundary” from the zero-width assertions.
\bPrintToChat\b
will search for that text, requiring either start-of-line or spaces/tabs or punctuation before, and end-of-line or spaces/tabs or punctuation after