I have a string like
"Employee Name is Jason Taylor"
I need a regular expression to extract what is in the left hand side of "is"
"Employee Name"
And another to extract what is in the right hand side of "is"
"Jason Taylor"
I have this
function BreakString(string) {
return string.replace(/((.+?)(is)).*/, '$1');
}
which returns "Employee Name is"
Can you please help me to solve this?
You missed a backreference:
or without regex