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 8331687
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T02:29:24+00:00 2026-06-09T02:29:24+00:00

I am having a hard time figuring out this XSD Regex match. Here is

  • 0

I am having a hard time figuring out this XSD Regex match. Here is the simpleType defininition:

  <xs:simpleType name="data-fuelcorrfact">
    <xs:restriction base="xs:float">
      <xs:pattern value="\-?[1-9]\.[0-9]{4}"/>
    </xs:restriction>
  </xs:simpleType>

I can guess that it needs a number between 1 and 9, a period, and another number betwen 0 and 9. I don’t understand what the \-? is and putting a value of 1.0 for example fails validation.

Can someone please help me decipher this regular expresion? Also, does anyone have any references for programs or websites that can explain a given XSD regex value should consist of? Thanks!

  • 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-09T02:29:25+00:00Added an answer on June 9, 2026 at 2:29 am

    I’m not familiar with XSD, but assuming that is uses the usual RegEx rules, here’s the breakdown:

    First, \-?. That matches one or zero dashes, i.e. negative or not. The \ is just an escape character, i.e. treat the - as an actual - character and not a special RegEx character. Outside of square brackets, though, it doesn’t usually have any special meaning. Might be an XSD thing.

    Next, [1-9] matches any non-zero numeral character (i.e. 1, 2, 3, 4, 5, 6, 7, 8, or 9). So a single-digit number.

    The \. does, in fact, match a period.

    Then we have [0-9]{4} which matches exactly 4 numeral characters (including zero now).

    So it’s looking for any number in (-10, 10) but not in (-1, 1) with exactly four decimal places. Strange behavior; I suspect the [1-9] should be [01-9] because it’s very weird to omit the values around 0 like that.

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

Sidebar

Related Questions

Not the biggest whiz on math here... having a hard time figuring this out.
I'm having a hard time figuring this out. Here's what I'm trying: ghci> :m
Having a hard time figuring out why this alert code is being called once
Having a hard time figuring out the best way to do this... I have
I'm having a hard time figuring this one out. Seems like no matter what
I am new here, but I am having hard time figuring out how to
I'm having some hard time figuring out what's wrong in this simple code: This
I'm having a hard time figuring out the best way to resolve a name
I'm having a hard time figuring out why this is not working. I have
I'm having a hard time figuring out how best to do this. I have

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.