Question: I tested and copied the regex from <https://regex101.com/> but when I include in my function I get Invalid regular expression: //^[+]?[0-9]{0,1}[-. ]?(?([0-9]{3}))?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/gm/: Invalid group error

```js
  public isPhoneValid(phone: string) : boolean {
    if (!phone) {
      return true;

    const regExp = new RegExp("/^[+]?[0-9]{0,1}[-. ]?\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/gm");
    return regExp.test(phone);
  }
```

Answer: 
The quotations around the regular expression is treating it as a string rather than as a regular expression. Removing them should do the trick. You can also drop the "new RegExp()" constructor all together.

```
const regExp = /^[+]?[0-9]{0,1}[-. ]?\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/gm;

```
You don't need such a complex statement - you can simply copy-paste the regex with the "/" and "/" characters as the delimiters.

```
 const regExp = /^[+]?[0-9]{0,1}[-. ]?\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/gm;

```