Regex 在coldfusion中从文本中提取数字

Regex 在coldfusion中从文本中提取数字,regex,coldfusion,Regex,Coldfusion,我有以下案文: “我哥哥喝了7杯咖啡,然后用A4纸打印了作业。然后他沿着I-90高速公路开车。” 我只想提取文本的数字(在本例中为7,4,90)。我怎样才能用coldfusion做到这一点 我怀疑必须使用REMatch函数,但我不擅长正则表达式,我感谢大家的帮助。只需使用REMatch,这将返回匹配号数组 <cfset str = "my brother drunk 7 cups of coffee and then printed his homework in A4 paper. He

我有以下案文: “我哥哥喝了7杯咖啡,然后用A4纸打印了作业。然后他沿着I-90高速公路开车。”

我只想提取文本的数字(在本例中为7,4,90)。我怎样才能用coldfusion做到这一点


我怀疑必须使用REMatch函数,但我不擅长正则表达式,我感谢大家的帮助。

只需使用REMatch,这将返回匹配号数组

<cfset str = "my brother drunk 7 cups of coffee and then printed his homework in A4 paper. He then drove down the I-90 highway">
<cfset arrSearch = rematch("[\d]+",str)>
<cfdump var="#arrSearch#">