change regexp matchin Ruby versions to support Ruby2.1