Regular Expressions are used with Cabinet Indexes and Document Type Indexes to validate the data entry in a common format. Below are some examples. If you need assistance with configuring, please reach out to DocuPhase Support.
- Date formatt mm/dd/yyyy also accepts the string 00/00/0000 --> ^(0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[- /.](19|20)\d\d$|^00/00/0000$
- date format yyyy-mm-dd --> ^(19|20)\d\d[-](0[1-9]|1[012])[-](0[1-9]|[12][0-9]|3[01])$
- empty string = ^$
- ^\$(?=.*\d)\d{0,6}(\.\d{1,2})?$ --> this forces a currency insert
-
Capitalize first letter of every word: \b(\w|['-])+\b
-
^[a-z A-Z0-9\/\\.'"]+$ no $ in currency (and other things)
-
^[0-9]{2}/[0-9]{2}/[0-9]{2}$ MM/DD/YY
-
[1-9][0-9]* will work for MM/DD/YY format as well
-
^[A-Z0-9]*$ All Caps and Numbers Only
Notes on Regular Expressions
- some of the operators for regular expressions include the or = |
- Brackets match a single character that is within them =[ ]
- brackets with a caret matches a character except for the ones in the brackets
- examples:
- .at matches any three-character string ending with "at", including "hat", "cat", and "bat".
- [hc]at matches "hat" and "cat".
- [^b]at matches all strings matched by .at except "bat".
- [^hc]at matches all strings matched by .at other than "hat" and "cat".
- ^[hc]at matches "hat" and "cat", but only at the beginning of the string or line.
- [hc]at$ matches "hat" and "cat", but only at the end of the string or line.
- \[.\] matches any single character surrounded by "[" and "]" since the brackets are escaped, for example: "[a]" and "[b]".
Regular Expression for Phone Numbers
^[0-9+\(\)#\.\s\/ext-]+$
- 123.456.7890
- (123)456-7890
- 1(123)456-7890 x123
Regular Expression for a Domain
\b((?=[a-z0-9-]{1,63}\.)(xn--)?[a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,63}\b
- abcd1234.org.net.com
Regular Expression for an Email
^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$
- abc123@def456.com.net.org
Comments
0 comments
Please sign in to leave a comment.