Page last modified 12:28, 11 Aug 2015 by juhako


    Table of contents

    Description of the method


    Description: .matches() method tells if the string matches a regular expression or not. The method only returns true if the entire string can be matched. The regular expression dot operator does not match line feeds. Read more about regular expressions e.g. from here:
    Available for: string
    Parameters: string regular expression
    Return type: boolean



    Context: HeaderType1
    OCL: self.Id.matches('[a-z]*')
    Description: The example rule checks if the string contains only lower case letters from a to z.


    The XML snippet below would pass this check as it only contains lower case letters.


    The other snippet below however would not pass this check as the string contains also upper case letters and digits.



    Attached you can find example schema and files which you can use for testing.