Add support to exclude range

[ fix #3155 ]