Fix handling of anchoring pattern when starting inside the string

Changes the handling of '^' to mean where you start looking in the
string and not the actual beginning of the string. This follows
lua. Also took the opportunity to standardise some function naming
conventions.