[progress Communities] [progress Openedge Abl] Forum Post: Re: Can We Use Normal Regular...

  • Thread starter Thread starter mparish
  • Start date Start date
Status
Not open for further replies.
M

mparish

Guest
As far as I know you can't use a regular expression inside a constraint expression in the custom data type (though that would be really nice if you could). You could just create a normal rule sheet to check that the PAN number conforms. Something like this The advantage of doing it in a rule sheet is that you can provide very specific error messages when the PAN does not conform. Though if the attribute was long this might get rather tedious to create. Or you can create an extended operator that checks if a string conforms to a regex expression. Example: Customer.pan.regex(' [A-Z,a-z]{5}[0-9]{4}[A-Z,a-z]{1} ' ) The code might look something like this Though this won’t tell you where the error is. Here’s an example of how regex might be used in a rule sheet:

Continue reading...
 
Status
Not open for further replies.
Back
Top