fix regexp for reverse order with functions