Professional Documents
Culture Documents
1
Document history
Version Date Author Changes made
1.0 10/12/2009 Laurent SEYMAN Document creation
1.1 7/16/2012 Laurent SEYMAN New template
1.2 8/1/2013 Laurent SEYMAN Update for EasyVista 2013
2
Index
A. Principle of functioning.............................................................4
C. Regular expressions..................................................................6
C.1. Definition.......................................................................................................6
C.2. Building a regular expression....................................................................6
3
A. Principle of functioning
The constraints-management system was implemented so that a valid entry format can be defined for each field for which this is
desired. This mechanism was positioned at the level of the Administration module, menu Parameters / Field Constraints.
This menu displays a list of fields and the associated entry constraints.
It is possible to create a new constraint using the button located on the grid, or to edit an existing constraint using the
wizard:
4
B. Creating a field constraint
Clicking on the button launches the wizard for entering a constraint. Then, you should enter a name for the constraint,
select the table in the drop-down list, then selects the list of associated fields. Once this has been done, the constraint should be
defined using a regular expression.
Before inserting or modifying data, the existing constraints will be checked. If there is an error, the user will see an error
message specifying the field that caused the problem.
5
C. Regular expressions
C.1. Definition
Regular expressions are patterns, created using ASCII characters, for manipulating character strings, meaning for finding
portions of the string that correspond to the pattern.
The symbols *, + and ?, respectively "zero or several", "one or several" and "one or nothing", provide the concept of numbers.
abc+ : string containing ab followed by one or several c ( abc , abcc ...)
Note:
The first number of the limit ( {0,2} , but not {,2} ) is obligatory. The symbols seen previously * , + and ? , are
equivalent to {0,} , {1,} and {0,1} .
A.{4} : string starting with a letter A and with a length of 5 characters; the last 4 being any character
Square brackets [ ] define a list of characters that are allowed (or forbidden). The - sign defines an interval. The character ^ after
the first square bracket indicates prohibition.
6
[abc]: string containing an a, un b, or a c
Note:
To search for a character that is one of the special characters, you must precede it with a backslash \ (except
between square brackets). A backslash must therefore be doubled: \\ .
The backslash \ must never be placed last when it is between square brackets, otherwise the expression is
erroneous because it considers that you are trying to escape the closing square bracket ]
To write a letter in uppercase or a backslash
Do not write [A-Z\]
But [\A-Z]
Inside the square brackets, each character represents what it is. To represent a ] ] you must put it first (or after a ^ if it is a
prohibition), a - is placed first or last.
A slash / must always be escaped using a backslash \ . Ex: if you wish to write all letters and the / are allowed , you
would write: [a-zA-Z\/]+.
A backslash \ must never be placed after or before a slash / if you wish to allow it.
[\+?{}.]: string which contains one of these six characters
7
E. Some examples of regular expressions
A.{4} : string starting with a letter A and with a length of 5 characters ; the last 4 being any character
[a-zA-Z]+: string containing one or more characters included between a and z or A and Z
[^\+?{}.]: string which does not contain one of these six characters