摘要: 1 uses RegularExpressions; //相关单元 2 3 const 4 pattern = '[A-Z]+d+'; //测试用的表达式 5 txt = 'AAA1 BBB2 AA11 BB22 A111 B222 AAAA'; //测试用的目标文本 6 7 {是否匹配成功} 8 procedure TForm1.Button1Click(Sender: TObject); 9 begin 10 if TRegEx.IsMatch(txt, pattern) then 11 ... 阅读全文
posted @ 2012-05-19 02:21 极度生存 阅读(563) 评论(0) 推荐(0) 编辑
摘要: 废话不说,上代码,简单之极。注意红色代码就可以了。unit Unit4;interfaceuses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, RegularExpressions;type TForm4 = class(TForm) edtIP: TEdit; btn1: TButton; lbl1: TLabel; ... 阅读全文
posted @ 2012-05-19 02:17 极度生存 阅读(393) 评论(0) 推荐(0) 编辑