Regular Expression, pattern matching in xsd

后端 未结 3 511
梦谈多话
梦谈多话 2020-12-16 15:58

I was wondering how to make a regular expression for any character except * and + . I\'ve tried ([^*+]) and (\\[^*+]) but

3条回答
  •  囚心锁ツ
    2020-12-16 16:41

    In the XML Schema regex flavor, you must not add regex delimiters (i.e., the / at either end of /^[^*+]+$/). You also don't need to use anchors (i.e., the ^ at the beginning and $ at the end); all regex matches are automatically anchored at both ends. That line should read:

    
    

    ...meaning the whole element must consist of one or more of any characters except * and +.

提交回复
热议问题