Could you use a back reference here for matching the closing quote to the opening one? If it is of any benefit to cut the check ```match[1] === match[3]```:

```/^\s*(['"])([^'"]*)(['"])\s*$/``` could be rewritten as ```/^\s*(['"])([^'"]*)(\1)\s*$/```