正则表达式(JS)

  1. 匹配两个特定符号之间的数据
匹配“大于”与“?”之间的数据:
str = "第1局比赛30分钟双方总人头数是否会大于50.1?" begin = str.search('大于') end = str.search('\?') alert(begin) alert(end) headCount = str.slice(begin+2, end) alert(headCount)
原文地址:https://www.cnblogs.com/wlemory/p/5138488.html