1

In my xsd I'm using negate to check for disallowed characters. This is within a restriction pattern tag:

^[^ab]+$

This will allow any string unless it contains either a or b.

My requirement is that the string can contain anything but a or b or cd (where c is allowed and d is allowed and dc is allowed but not cd).

From what I've read the Metacharacters inside square brackets does not include ( ) 's for grouping.

Is there another way to meet my requirement so that the xsd will validate that we are receiving valid data?

Thank You very much for your assistance.

SparkAndShine
  • 17,001
  • 22
  • 90
  • 134
mattgoss
  • 31
  • 2
  • C. M. Sperberg-McQueen addresses this tricky topic (disallowing a substring) very well in [**XML schema restriction pattern for not allowing specific string**](http://stackoverflow.com/questions/37563199/xml-schema-restriction-pattern-for-not-allowing-specific-string). – kjhughes Sep 02 '16 at 13:52

0 Answers0