|
Hi Everyone, Once I was told where Custom Field Validation is maintained
in RT 3.6.0, I thought I make this small contribution to RT 3.6.0. The
following code snippet contains several useful regexp validations. Two of these
are provided with RT 3.6.0 (Mandatory, Digits), the new additions are as
follows:
I hope you find this information useful. Also, if folks have
additional regular expressions they should contribute them to this forum so
they can be shared with everybody. Take care! Nick The following module contains the Custom Field Validation
definitions for RT 3.6.0: /opt/rt3/share/html/Admin/CustomFields/Modify.html The following code begins at line 82; I removed the regexp
for “Years” and added new code beginning at line 89: <& /Widgets/ComboBox, Name =>
'Pattern', Default =>
$CustomFieldObj->Pattern, Size => 50, Values => [
'(?#Mandatory).', '(?#Digits)^[\d.]+$',
'(?#Float)^(\+|-)?([0-9]+\.?[0-9]*|\.[0-9]+)([eE](\+|-)?[0-9]+)?',
'(?#DateYYYYMMDD)^(19|20)\d\d([-
/.])(0[1-9]|1[012])\2(0[1-9]|[12][0-9]|3[01])$',
'(?#DateMMDDYYYY)^(0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])[-
/.](19|20)\d\d',
'(?#DateDDMMYYYY)^(0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[-
/.](19|20)\d\d',
'(?#Email)[EMAIL PROTECTED]',
'(?#IPAddress)^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$',
'(?#USZipCode5)^\d{5}$',
'(?#USZipCode9)^\d{5}-\d{4}$',
'(?#USZipCode5or9)^\d{5}(-?\d{4})?$',
'(?#USTelephone)^1?\s*-?\s*(\d{3}|\(\s*\d{3}\s*\))\s*-?\s*\d{3}\s*-?\s*\d{4}$',
'(?#RowRackHeight)^\d{2}-\d{2}-\d{2}$', '', ], &> --------------------------------------------------------------------------------- Nick
Metrowsky Consulting
System Administrator 303-684-4785
Office 303-684-4100
Fax DigitalGlobe
®, An Imaging and Information Company --------------------------------------------------------------------------------- |
_______________________________________________ http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
Community help: http://wiki.bestpractical.com Commercial support: [EMAIL PROTECTED] Discover RT's hidden secrets with RT Essentials from O'Reilly Media. Buy a copy at http://rtbook.bestpractical.com We're hiring! Come hack Perl for Best Practical: http://bestpractical.com/about/jobs.html
