Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7836217
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T14:01:52+00:00 2026-06-02T14:01:52+00:00

Is this supposed to work? When i use <xs:pattern value=(!red|green|blue)/> everything is fine, but

  • 0

Is this supposed to work?

When i use

 <xs:pattern value="(!red|green|blue)"/>

everything is fine, but using:

<xs:pattern value="(?!red|green|blue)"/>

(notice the added “?”)

EDIT: found this in another SO question, it doesnt work either:

^((?!red|green|blue)|((red|green|blue).+)).*$

Both causes:

/home/asdf/.rvm/gems/ruby-1.9.3-p125@tretti_order/gems/nokogiri-1.5.2/lib/nokogiri/xml/schema.rb:37:in `from_document': Element '{http://www.w3.org/2001/XMLSchema}pattern': The value '(?!red|green|blue' of the facet 'pattern' is not a valid regular expression. (Nokogiri::XML::SyntaxError)
    from /home/asdf/.rvm/gems/ruby-1.9.3-p125@tretti_order/gems/nokogiri-1.5.2/lib/nokogiri/xml/schema.rb:37:in `new'
    from /home/asdf/.rvm/gems/ruby-1.9.3-p125@tretti_order/gems/nokogiri-1.5.2/lib/nokogiri/xml/schema.rb:8:in `Schema'
    from xml_validate.rb:12:in `<main>'

Context:

    <xs:simpleType name="attributeIdType">
    <xs:annotation>
      <xs:appinfo>Attribute Id Type.</xs:appinfo>
      <xs:documentation source="http://www.web3d.org/x3d/specifications/ISO-IEC-19775-1.2-X3D-AbstractSpecification/Part01/fieldsDef.html#SFDouble"/>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:whiteSpace value="collapse"/>
      <xs:pattern value="(?!red|green|blue)"/>
    </xs:restriction>
  </xs:simpleType>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T14:01:59+00:00Added an answer on June 2, 2026 at 2:01 pm

    What you have with (?!foo) is called a “zero-width negative lookahead assertion”; it says “Make sure that, standing at this spot and looking forward, you cannot match this pattern.”

    According to this page XML Schema’s pattern does not support lookarounds of any sort (positive or negative, forward or backward).

    However, since you say, “The purpose is to make sure that if a string starts with ABC_PRODUCT_ it only ends with a certain string.” you don’t need a lookaround. You can simply do this:

    pattern="(foo|bar_(jim|jam)"
    

    This will match “foo”, “bar_jim” and “bar_jam”, but not “bar_zzz”.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is supposed to work yet just says no stocks table - supposed lost
Why does this fail, it's supposed to be simple and work ? fisier.seekg(0, ios::end);
How are you supposed to dispose of a BitmapSource ? // this wont work
This program is supposed to determine how many units are stored in the value
OK, this probably is supposed to be the easiest thing in the world, but
I tried to use copy constructor using statement: X y = X(); But copy
I'm trying to return json content read from MySQL server. This is supposed to
This code is supposed to be able to sort the items in self.array based
This code is supposed to read postfix problems from a file and and write
This piece of code is supposed to go through a list and preform some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.