cleaned code
implementation of Regex::part_of_text_search
optimization and tests