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

The Archive Base Latest Questions

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

Could anybody help me with regular expression as mentioned. I have an xml element

  • 0

Could anybody help me with regular expression as mentioned.

I have an xml element ‘docs’ which has an attribute ‘range’ where range should take only values in the below format.

range = “1,2,3,4,5”

or

range = “1,2,3-6,10-12,15,20-30”

or

range = “all”

A littel help will be much appreciated.
Thanks in advance.

  • 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:55:13+00:00Added an answer on June 2, 2026 at 2:55 pm
    ^\d(?!.*,-)[\d\,\-]*\d$|^all$|^\d+$
    

    Should work for your numbers. Input can only be numbers, commas, or dash or the word all.

    http://regexr.com?30p7f

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

Sidebar

Related Questions

Could anybody help me make a proper regular expression from a bunch of text
Could anybody provide me the regular expression for the following patterns? $1234 $31234.3 $1234.56
Could anybody help me with some Jquery. I have a <div> with a bunch
Could anybody help me to understand this issue? The problem is: I have a
Could anybody help me, please? I have this code: Process a; try { a
Could anybody help me how can I set this echo command which you can
I was wondering if anybody could help me with a method of creating a
I am new to php and was wondering if anybody could help me with
Could anybody help me to list Some Good Sites that are describing about Complete
Could anybody help me figure out the syntax of the code below? AddonInfo {

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.