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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T03:57:26+00:00 2026-06-08T03:57:26+00:00

Where can I find regular expressions for the datatypes defined in XSD? The XSD

  • 0

Where can I find regular expressions for the datatypes defined in XSD?

The XSD specification includes regular expressions for the datatypes, however they doesn’t seem to be correct. For example, for xsd:float the suggested regular expression is (\+|-)?([0-9]+(\.[0-9]*)?|\.[0-9]+)([Ee](\+|-)?[0-9]+)?|(\+|-)?INF|NaN, which, however, matches even strings like “0.this is not a float”:

var floatRegex = /(\+|-)?([0-9]+(\.[0-9]*)?|\.[0-9]+)([Ee](\+|-)?[0-9]+)?|(\+|-)?INF|NaN/;
floatRegex.test("0.this is not a float"); # returns true

Am I missing something from the XSD specification? Is there other source of correct regular expressions for XSD datatypes (e.g., RegExLib.com doesn’t have them)?

  • 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-08T03:57:29+00:00Added an answer on June 8, 2026 at 3:57 am

    If you don’t want to allow anything around, then add ^ at the beginning and $ at the end (with grouping):

    ^( regex )$

    var floatRegex = /^((\+|-)?([0-9]+(\.[0-9]*)?|\.[0-9]+)([Ee](\+|-)?[0-9]+)?|(\+|-)?INF|NaN)$/; 
    floatRegex.test("0.this is not a float"); # returns false
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hay, i can't seem to find any regular expressions online to remove <h1></h1> tags
Can regular expressions be used to perform arithmetic? Such as find all numbers in
I'm looking for a regular expressions string that can find a word or regex
I'm looking for a regular expression that can find the alpha representation of a
I'm trying to find a single regular expression that I can use to parse
How can I update this regular expression to find and replace not just /news/
This question is meant to be language agnostic. Using only Regular Expressions, can I
I'm trying to parse through a string with regular expressions (.NET) and find all
I'm trying to find comment blocks in PHP source code using regular expressions in
Trying to learn regular expressions. As a practice, I'm trying to find every word

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.