Add regex

fixes #9

while the number of matches replaced are less then the total number of matches and a match exists, add the replacement to the rewritten variable. If the match occurs at the end of the buffer and the match is less than max_match_len add the match to the tail.

after the while loop exits check if the tail has some length. If tail is an empty string and the haystack from the index of the last match is greater than max_match_len then set tail to the last max_match_len characters. If tail is an empty string and the haystack from the index of the last match is less than max_match_len then set tail to all the characters after the last match.

the data that should be queued if there is a match and if the haystack is greater than the tail is the rewritten string plus the any characters until where the tail begins.  if there is a match and the haystack is less than the tail then the data to be queued is just the rewritten string.

if there is no match then the data to be queued is the haystack minus the tail.

both search strings and RegEx are handle the same (no more permuteMatch). If the search is a string set max_match_len to the the length of the string. Because any potentially partial match is added the tail there is no need for permuteMatch.