I have a string "@{Name; [email protected]}"
I want to write a regular expression that extracts Name and 11112121 from the above string
This is what I tried.
function formatName(text){
var regex = /@\{([^;]+); ([^\}]+)\}/
return text.replace(
regex,
'$1, $2'
);
}
The above gives Name, [email protected]. But I want only Name, 11112121