Regular Expressions

Previous  Top  Next


Reference > Regular Expressions

CISPro Global supports the use of regular expressions for validating input for text properties. A regular expression is a pattern that describes text. Essentially, using regular expressions in CISPro Global means using input masks to limit what data users can save in a field. Data entry can be restricted by length, character type, case, etc.

 

A regular expression (or RegEx) can be used to validate data entry for material properties, lot properties, and container properties. CISPro Global assumes the user is familiar with the syntax* of regular expressions. Regular expression interpretation is browser-dependent, and CISPro Global supports Internet Explorer version 6.

 

Creating RegEx Input Masks

Creating RegEx input masks in CISPro Global involves two steps: creating the RegExes themselves, and applying them to properties. Regular expressions for properties are created on the Configure regex_library page, accessible from System Configuration.

 

Create a New RegEx Input Mask

1.Click the System link on the Home Page.
2.Click the Properties RegEx link under Data Configuration to open the Configure regex_library page
3.On the menu, click Regex, and select New Regex
4.Type a name for the new regular expression in the Regex Name text box
5.Type the regular expression in the Regex text box
6.Click Save

 

RegularExpressionExample

 

Applying RegEx Input Masks to Properties

RegEx input masks can be applied to the Text property type. To apply RegEx input masks for the Text property type, follow the instructions in this section.

 

Apply a RegEx Input Mask to a Property

These instructions apply to existing properties. See Properties for instructions for applying input masks during the property creation process.

 

1.Select a Text property on the Configure Properties page
2.From the Regex Validation pull-down list, select an input mask
3.Click Save

 

HazardTabWithProperties

 

How the RegEx Input Mask Works for Material and Container Properties

The advantage of using input masks for container and material properties can be seen immediately, once the input mask is created and applied to a property.

 

Test an Input Mask

1.Select a material, lot, or container
2.Add a property
3.In the Properties grid, click the property's Value link, which reads 'blank'
4.Enter a value for the property
5.Click Save

 

If the value entered passes the input masks validation test, it will be saved. If the property value fails the validation test, CISPro Global will alert the user with a warning message, and prevent the value from being saved until it is valid.

 

Some Examples of Valid RegExes in CISPro Global

Following are some examples for the user's reference.

 

Phone Number:   \\d{3}\\-\\d{3}\\-\\d{4}
TEC: Toxic Effect Code Format: ANN [a-zA-Z]{1}\\d{2}
BRN (Beilstein Registry Numbers for Organic chemicals):  xx-xx-xx [numeric] \\d{2}\\-\\d{2}\\-\\d{2}

 

 

*A thorough discussion of regular expressions and how they work is beyond the scope of the CISPro Global help system. There are many easily accessible tutorials and sources of examples that the user can consult.