简体   繁体   中英

Regex error in TIBCO designer?

I am trying to consume WSDL file in TIBCO Desginer, but its throwing error for regex pattern defined for date attribute in WSDL

WSDL File

> <xsd:element maxOccurs="1" minOccurs="0" name="contractStartDate_line"

    > nillable="true">
    >       <xsd:simpleType>
    >           <xsd:restriction base="xsd:string">
    >               <xsd:pattern value="([0-9][0-9][0-9][0-9])-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])
    > ([0-1]?[0-9]|2[0-3]):([0-5]?[0-9]):([0-5]?[0-9])|"/>
    >           </xsd:restriction>
    >       </xsd:simpleType>

>     </xsd:element>

Error in TIBCO

#dt-regex Pattern "([0-9][0-9][0-9][0-9])-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01]) ([0-1]?[0-9]|2[0-3]):([0-5]?[0-9]):([0-5]?[0-9])|"/>" is an invalid regular expression: invalid atom: empty

Any thoughts?

Nitesh

I'm not sure if this is a bug or intentional, but Designer won't accept empty string with alternation (|). The following regex is accepted by Designer and probably suits your requirements:

^([0-9][0-9][0-9][0-9])-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])([0-1]?[0-9]|2[0-3]):([0-5]?[0-9]):([0-5]?[0-9])$|^$

On the other hand is it desired to allow an empty value when you can omit the whole element (minOccurs="0")? Is there any functional difference between empty and omitted element?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM