[yunqa.de] TDIRegExMaskEdit Problem

  • From: "John L Smith" <jlsmith@xxxxxxxxxxx>
  • To: <yunqa@xxxxxxxxxxxxx>
  • Date: Tue, 18 Mar 2008 11:35:59 +1100

TDIRegExMaskEdit Problem

I have a Delphi form with a TDIRegExMaskEdit component named DIRegExMaskEdit1.

OnEnter of DIRegExMaskEdit1.
I create a TDIPerlRegEx object and assign it to variable DIPerlRegEx1
DIPerlRegEx1.CompileMatchPatternStr('^[a-zA-Z-]+$');
DIRegExMaskEdit1.RegEx := DIPerlRegEx1;
My aim is to allow just one English word to be entered in the mask field.
I enter some characters in the field, nd get the expected behaviour.

OnExit of DIRegExMaskEdit1.
 I carry out some checks on the English word using DIPerlRegEx1.Match(0);
Then I free the DIPerlRegEx1 object.

If I then enter the DIRegExMaskEdit1 component again and use the backspace key 
to remove characters from the word that I previously entered, the backspace key 
fails to remove the last remaining character, no matter which character that is.
Is this a bug in TDIRegExMaskEdit or is it a problem with the regular 
expression that I am using in DIPerlRegEx1?

Regards

John

Other related posts: