本文整理自网络,侵删。
引用单元:RegularExpressions
aStr:=TRegEx.Replace(aStr,'[\x{4E00}-\x{9FA5}]',' ');aStr:=TRegEx.Replace(aStr,'^[1-9]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])\s+(20|21|22|23|[0-1]\d):[0-5]\d:[0-5]\d',''); //年月日 时间aStr:=TRegEx.Replace(aStr,'([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)-(0[1-9]|[12][0-9]|30))|(02-(0[1-9]|[1][0-9]|2[0-8])))',''); //年月日aStr:=TRegEx.Replace(aStr,'([0-9]{1,2}:[0-9]{1,2})?(:[0-5]{0,1}[0-9]{1})',''); //时间格式hh:mm:ssaStr:=TRegEx.Replace(aStr,'0[0-9]:[0-5][0-9]|1[0-9]:[0-5][0-9]|2[0-3]:[0-5][0-9]',''); //时间格式hh:mmaStr:=TRegEx.Replace(aStr,'([\d]{4})([\d]{4})([\d]{4})([\d]{4})([\d]{0,})?',''); //银行卡
相关阅读 >>
Delphi dblookupcombobox组件的使用方法
更多相关阅读请进入《Delphi》频道 >>