【问题标题】:Regex error in TIBCO designer?TIBCO 设计器中的正则表达式错误?
【发布时间】:2012-06-28 17:40:35
【问题描述】:

我正在尝试在 TIBCO Desginer 中使用 WSDL 文件,但它为 WSDL 中的日期属性定义的正则表达式模式抛出错误

WSDL 文件

> <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>

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

有什么想法吗?

尼特什

【问题讨论】:

    标签: wsdl tibco


    【解决方案1】:

    我不确定这是错误还是故意的,但 Designer 不会接受带有交替 (|) 的空字符串。以下正则表达式被 Designer 接受并且可能适合您的要求:

    ^([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])$|^$

    另一方面,当您可以省略整个元素(minOccurs="0")时,是否希望允许一个空值?空元素和省略元素在功能上有区别吗?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-04-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多