Actor Name Matching (SOLVED)

I'm trying to use a Conditional Branch with this script to match Actor 6's name to Actor 1's name.

Let's use Wentz for example. Wentz is Actor 1 in the game. During the Name Input (which is Actor 6), if the player puts in their name as, Wentz, the game wouldn't allow it. I need the match to be case-insensitive to pretty much check any potential capitalization variations that the player might put in, like wENtz or WeNtZ. Same thing would apply for the other Actors in the game as well.

This is the script I tried to write:

(/$gameActors.actor(6)/i.match("$gameActors.actor(1)"));


Spoiler: Event Screenshot
103762-89f1e5c08eb7912548f33bdaf45464b8.jpg

Every time I try this, the Conditional Branch is skipped altogether. I'm not sure if I just CAN'T do something like this or if I'm genuinely messing up somewhere.

Any thoughts?
I did not test it, but this should work:
Code:
$game_actors[6].name.toLowerCase() != "wentz"

if yes: do nothing, they are not equal.
else: both are called wentz, you have to restart the renaming.
end

Edit:
The RMMV Scriptcall List can be also very usefull:
https://forums.rpgmakerweb.com/index.php?threads/rpg-maker-mv-script-call-list.46456/

Edit2:
Somehow i copy pasted the wrong line:
$gameActors.actor(6).name().name.toLowerCase() != "wentz"
@Rockenberg If you want to put variables into a RegExp pattern, create a new RegExp object :

Code:
var regex = new RegExp($gameActors.actor(2).name(),"i"); regex.test($gameActors.actor(1).name())

Also, if you are attempting to compare the names of each character against one another, you will have to specify the '_name' variable or use the 'name' function of each actor object.

EDIT: I also used the 'test' function of RegExp in my example above, which will return a boolean value (true, false). The 'match' function will return either an array of values or null ... which will still work fine, but I typically use 'test' when I want a yes or no answer.
@Bex @Ossra
Perfect! Thank you both so much!

I used the code @Ossra provided and it's working perfectly now!
If actor #6 is named 'Ryan' and actor #1 is named 'Bryan', that RegExp will return true. Is that what you want?

If you want to check if they're equal, this is way simpler:
Code:
$gameActors.actor(1).name().toLowerCase() === $gameActors.actor(6).name().toLowerCase()
@Aloe Guvner
It's funny, I didn't realize that issue until just now! Thank you for the update and it works way more accurately!

Original thread: https://forums.rpgmakerweb.com/threads/actor-name-matching-solved.113839/