Dashboard > WebWork > ... > Validation > regex validator
  WebWork Log In View a printable version of the current page.  
  regex validator
Added by tm_jee, last edited by tm_jee on Dec 11, 2005  (view change)
Labels: 
(None)

Description

Validates a string field using a regular expression.

Parameters

  • fieldName - The field name this validator is validating. Required if using Plain-Validator Syntax otherwise not required
  • expression - The RegExp expression REQUIRED
  • caseSensitive - Boolean (Optional). Sets whether the expression should be matched against in a case-sensitive way. Default is true.

Examples

<validators>
    <!-- Plain Validator Syntax -->
    <validator type="regex">
        <param name="fieldName">myStrangePostcode</param>
        <param name="expression"><![CDATA[([aAbBcCdD][123][eEfFgG][456])]]<>/param>
    </validator>

    <!-- Field Validator Syntax -->
    <field name="myStrangePostcode">
        <field-validator type="regex">
           <param name="expression"><![CDATA[([aAbBcCdD][123][eEfFgG][456])]]></param>
        </field-validator>
    </field>
</validators>

Site powered by a free Open Source Project / Non-profit License (more) of Confluence - the Enterprise wiki.
Learn more or evaluate Confluence for your organisation.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.2.9 Build:#527 Sep 07, 2006) - Bug/feature request - Contact Administrators