考虑到它的年龄,这不太可能仍然是一个问题,但它被列为未回答,因此为了任何有类似问题的人的利益......
这是一个快速模式,可以将所有匹配项提取到一个数组中——它可能需要也可能不需要变得更灵活:
<cfset Matches = rematch( '\D+ \d\.\d{3} \d+\.\d{3} \d\d -\d\.\d{3} 0.000' , Input ) />
然后遍历这些结果,对于每个匹配项,您可以将名称+国家与数字分开:
<cfset NameAndCountry = trim(Left( CurMatch , refind('\d',CurMatch)-1 )) />
<cfset Numbers = Right( CurMatch , Len(CurMatch)-Len(NameAndCountry) ) />
从名称中提取国家并不简单 - 实际上并没有任何规则来确定哪个是哪个,因此它需要一组国家来循环并检查,例如:
<cfloop index="CurCountry" array=#Countries# >
<cfif NameAndCountry.endsWith( CurCountry ) >
<cfset Name = Left( NameAndCountry , Len(NameAndCountry)-Len(CurCountry) />
<cfbreak />
</cfif>
</cfloop>
对于数字,使用带有空格作为分隔符的ListToArray可以将它们分开。