Need to use Tperlregex package
Determine if there are only letters and numbers
function Ispurenumberoralpha (s:string): Boolean;
Var
Reg:tperlregex; Declaring a regular expression variable
Begin
Reg: = Tperlregex.create; Establish
Reg. Subject: = s; This is the source string to replace
Reg. RegEx: = ' ^[a-za-z][a-za-z0-9_]{5,11}$ '; This is the expression, here is the substring ready to be replaced
Reg. RegEx: = ' ^[a-za-z][a-za-z0-9_]{3,19}$ ';
Result: = Reg. Match;
Freeandnil (REG); or Reg. Free
End
Determine if there are only letters and numbers
function Ispurenumberoralphabyengineer (s:string): Boolean;
Var
Reg:tperlregex; Declaring a regular expression variable
Begin
Reg: = Tperlregex.create; Establish
Reg. Subject: = s; This is the source string to replace
Reg. RegEx: = ' ^[a-za-z][a-za-z0-9_]{3,19}$ ';
Result: = Reg. Match;
Freeandnil (REG); or Reg. Free
End
Delphi Regular Expressions