1 2 3 4 5 6 7 8 9 10 11 12 13 14
| function getText(str,start,end){ var regexPattern = new RegExp(start + '(.*?)' + end); var match = str.match(regexPattern); if (match) { var result = match[1]; console.log('Result:', result); return result } else { return "没有找到数据!" } }
|