Removed regex variables in favor of a function that grabs and returns
the position value in the debug content string.
Restored regexes in debug function. I think the problem was with the
regex itself not capturing matches properly.