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