Can regular expression be used to remove a person’s first name in Javascript?
I want it to display "Dr. House" instead of Dr. Greg house and I am only allowed to modify "const re = /^(w+.s)(w+sw+)$/;". Can anyone help me? here is the code const userName = "Dr. Greg House"; // Code will…