Regular Expression Validation

Regular Expression Validation

Postby twildt » Fri Nov 21, 2014 8:44 am

Trying to write a regular expression for an amount field. Field needs to be greater than 0.00

How can I achieve this?

0.00 = invalid
0.01 = valid

or

>= 0.01
twildt
Participant
 
Posts: 108
Joined: Tue Dec 17, 2013 2:09 pm

Re: Regular Expression Validation

Postby dkekesi » Fri Nov 21, 2014 12:42 pm

Code: Select all
If Val(KfxFieldName) <= 0 Then MsgBox("Value must be greater than zero!")

This way you do not need RegEx. I'd suggest you use a numeric field type (like decimal) to avoid problems with regional settings.
Best Regards,

Daniel Kekesi
DocSoft Hungary
Image
dkekesi
Participant
 
Posts: 2569
Joined: Thu Dec 08, 2005 12:56 am
Location: Budapest, Hungary

Re: Regular Expression Validation

Postby russell@centuryc.com » Mon Nov 24, 2014 5:59 pm

Regular Expressions are generally used to validate the format. For example, it be sure it digit, period, digit, digit and not something like O.45 (oh) or 0.358
Russell
russell@centuryc.com
Participant
 
Posts: 3374
Joined: Wed May 17, 2006 12:53 pm
Location: USA

Re: Regular Expression Validation

Postby twildt » Mon Dec 01, 2014 2:24 pm

Actually I was referring to the "Field Locater" properties. I was trying to build a format for the field locater and only allow 0.01 or greater.

Sorry, should have been more specific.
twildt
Participant
 
Posts: 108
Joined: Tue Dec 17, 2013 2:09 pm

Re: Regular Expression Validation

Postby dkekesi » Mon Dec 01, 2014 4:07 pm

Ah, I thought we were in another forum, sorry :)
This is actually built into KTM. The format locator has an icon row on the format tab. Click on the $ icon, and select amounts. Tadaaa, you have them there, built in.
Of course you may need to tweak the built in regex, for example to allow for both comma and dot as decimal separator, make the decimal part optional, allow for dot or comma as thousands separator, look for negative amounts, allow for more than 2 decimal digits, etc. Possibilities are endless.
Best Regards,

Daniel Kekesi
DocSoft Hungary
Image
dkekesi
Participant
 
Posts: 2569
Joined: Thu Dec 08, 2005 12:56 am
Location: Budapest, Hungary


Return to Kofax Transformation Modules General Discussion

Who is online

Users browsing this forum: No registered users and 2 guests

cron