Copy strings.
- compile the scanning regexp once