I need to get part of a string inside round brackets, for example the string could be:
FirstName LastName ( [email protected] )
I'm using the following code:
let string = 'FirstName LastName ( [email protected] )';
const regExp = /(([^()]*))/g;
let email = string.match(regExp);
When I try to get and print the email variable I get this:
FirstName LastName ,,[email protected],,
What's wrong with my code? Thanks a lot for any help.