Squash with refactor str_to_reg.

- xrealloc instead of xmalloc/memcpy.
- Use xmemcnt/STRLEN.