A string of variable length, with 3 characters at the beginning and 3 characters at the end, and the rest of the content is replaced by a "" sign, and the number of "" is the same as the length of the content after removing the first and last 3 characters.
for example, let str = "123456789" becomes 123 * 789
the requirement is easy to realize. I"d like to ask, can it be realized with a regular sentence?
if the length is fixed
str.replace(/(.{3}).{3}(.{3})/, "$1***$2")
can be realized, mainly because the length is not fixed.