匹配“大于”与“?”之间的数据:str = "第1局比赛30分钟双方总人头数是否会大于50.1?" begin = str.search('大于') end = str.search('\?') alert(begin) alert(end) headCount = str.slice(begin+2, end) alert(headCount)