newuser 发表于 2010-12-16 15:39:56

[已解决]正则:能否帮助精简正则表达式?

本帖最后由 newuser 于 2010-12-17 09:04 编辑

#include<array.au3>
Local $Num="Sharon Lee Smith, Design Works Incorporated, CA, 95012"
Local $Result=StringRegExp($Num,'([^,]*),([^,]*),([^,]*),(.*)',3)
;Local $Result=StringRegExp($Num,'([^,]*),\w*',3)
;Local $Result=StringRegExp($Num,"(([^,]*),){3}(.*)",3)
_ArrayDisplay($Result)
([^,]*),([^,]*),([^,]*),(.*)能否写的更精简些?用代码中的2个方法均无效?

shenrenba 发表于 2010-12-16 17:02:25

afan 发表于 2010-12-16 18:18:07

[^,]+
页: [1]
查看完整版本: [已解决]正则:能否帮助精简正则表达式?