正则表达式从大文本中找到 8 位数字
Regex find 8 digit from big text
我有这样的数据Your LancerPoint ID number is: 10504139 Your LancerPoint username is: dbrooke CA Resident Status: In State Resident
我需要提取正则表达式帮助中的 ID 号 10504139
regexr.com/5s2q2
您可以使用\d{8}
此处\d为匹配数字
{8} 正好匹配其中的 8 个。
如果您有另一组数字,例如 10 位数字,您可以更具体地补充 Mayank 的答案。
/(?<=LancerPoint\sID\snumber\sis:\s)\d{8}(?=\s)/
我有这样的数据Your LancerPoint ID number is: 10504139 Your LancerPoint username is: dbrooke CA Resident Status: In State Resident
我需要提取正则表达式帮助中的 ID 号 10504139
regexr.com/5s2q2
您可以使用\d{8}
此处\d为匹配数字
{8} 正好匹配其中的 8 个。
如果您有另一组数字,例如 10 位数字,您可以更具体地补充 Mayank 的答案。
/(?<=LancerPoint\sID\snumber\sis:\s)\d{8}(?=\s)/