Match all regex

matchall function to find all occurrences of a regex pattern in a string.

Follow up on the last pull request - https://github.com/JuliaLang/julia/pull/3525

These commits fix the issues that were raised there.