Update index.js

- Replaced `.trim()` and `.replace()` calls with `.match()`
- Converted `"` to `'`