Regular expressions can be used on Text fields to ensure that index data matches a required format. (e.g. E-mail addresses). Practically this is used to ensure that when documents are saved to Thereforeâ„¢, the index data is correct. The regular expression dialect used is JavaScript.
How do I use regular expressions?
1.Open the desired category and right-click on the Text field that you would like to check using a regular expression. Select Properties.
2.In the Field Properties dialog choose Regular Expression. Type in the regular expression or click the arrow button for a reference list of basic elements and sample expressions. The table below shows some basic uses.
|
|
|
PN001
PN293
|
First two characters are PN followed by three single digit numbers.
|
PN\d{3}
|
GH001
HZ673
|
First two characters can now be any capital letter from the English alphabet.
|
[A-Z][A-Z]\d{3}
|
GHSTE001
Z999
|
Any number of capital letters plus three digits
|
[A-Z]+\d{3}
|
HJ.001
J.676
|
Any number of capital letters plus three digits separated by a full stop.
|
[A-Z]+\.\d{3}
|
AAB.346/GHT
AAB.346/AAA
|
Any number of capital letters plus three digits separated by a full stop followed by a slash and then three more capital letters.
|
[A-Z]+\.\d{3}/[A-Z]{3}
|
AAA.000/BBZ-Tz1
AAA.000/BBZ-AFz
|
Any number of capital letters plus three digits separated by a full stop followed by a slash and then three more capital letters followed by a dash and then three alphanumeric characters.
|
[A-Z]+\.\d{3}/[A-Z]{3}-\w{3}
|
ÄÜÖ.000/ÄÄÄ-AFz
ÄDD.111/ÄÄÄ-00e
|
Any number of Unicode capital letters plus three digits separated by a full stop followed by a slash and then three more Unicode capital letters followed by a dash and then three alphanumeric characters.
|
[[:upper:]]+\.\d{3}/[[:upper:]]{3}-\w{3}
|
3.In this case we chose the email sample from the help list. The second field can be used to test the expression, and will report "No match!" until what the user types matches the specified regular expression. The last field is an optional field that will be displayed as an example when a user enters a non-matching value.
|