XML Schema pattern problem with regular expressions

J

Jeff

For the life of me, I can't create a working regular expression for a
schema pattern to do the following:

Validates if an entire word does NOT match the entire word in the
pattern.

For example, in the pattern the word my be "foo". If the word "foo" is
in my XML it should fail. If any other word, such as "cat" or "foot" or
"barfoo" is in the XML, it should pass.

The closest I've come for the regular expression in the pattern is
"(?i)^(?!foo)[A-Za-z]*"

The only problem is it invalidates anything starting with "foo" that
contains other characters such as "foobar". "Foobar" should pass while
the ONLY string that shouldn't is "foo".

Anyone know how I can do this in the W3 Schema regular expression
pattern?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top