MV RegEx for several text splitters.

I'm learning regular expressions to improve some of my code to handle text and I come up with following format of text splitter:
Code:
***** Tallanar *****
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed 
do eiusmod tempor incididunt ut labore et dolore magna aliqua. 
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris 
nisi ut aliquip ex ea commodo consequat.
***** Carla *****
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed 
do eiusmod tempor incididunt ut labore et dolore magna aliqua. 
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris 
nisi ut aliquip ex ea commodo consequat.

How it looks like regex to replace ***** any actor name ***** to any char of my choosing?
I think this regular expression will match all occurrences of *****text***** (untested):
JavaScript:
/\*{5}(.*?)\*{5}/g
I.e. "capture the shortest string of characters between two sets of *****". The g flag at the end means "global match", i.e. match every occurrence within the string. .*? is a non-greedy match for a string of any number of characters.

Assuming that's correct, you could use it with String#replace to do your substitutions, e.g.
JavaScript:
myText.replace(/\*{5}(.*?)\*{5}/g, function(_, p1) { return p1; });
Here the replacer function literally just returns the captured text, e.g. Tallanar .

More info on String#replace and regular expressions:
That... Expression is working 100%, I cannot express my gratitude for your help.
tenor.gif

Original thread: https://forums.rpgmakerweb.com/threads/regex-for-several-text-splitters.138586/