Remove redundant code

According to the MDN documentation on `RegExp.lastIndex`:

```
This property is set only if the regular expression used the "g" flag to indicate a global search.
```

However, the `regex` variable does not have the global flag associated with it so this code seems redundant. The global flag *is* being used to remove "whitespace" but that is not associated with the regular expression in question.

If I am overlooking something we should create tests for this line of code.