fix_for_reverse_order_with_functions

fix for reverse_sql_order using regexp (for details of bug see pull request #8225)