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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T10:58:06+00:00 2026-06-18T10:58:06+00:00

Good evening, I’m learning regular expressions to PHP. I am not managing to make

  • 0

Good evening, I’m learning regular expressions to PHP. I am not managing to make 1 to 30 and 1 to 10. For 1 to 9, I thought [1-2-3-4-5-6-7-8-9] or [1-9]{1}, which is more correct? 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-18T10:58:07+00:00Added an answer on June 18, 2026 at 10:58 am

    For 1 to 9, there is straight forward regex that is [1-9].
    For 1 to 10, and 1 to 30, a combination of rules are to be applied.
    For 1 to 10, you can use this:

    10|[1-9]
    

    For 1 to 30, this regex could be used:

    (30)|([12][0-9])|([1-9])
    

    or

    (30)|([12]\d)|([1-9])
    

    the first part 30, would look for exact match i.e. 30.
    the second part [12]\d or [12][0-9], would look for numbers between 10 to 29.
    the last part [1-9] would look for numbers between 1-9.

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

Sidebar

Related Questions

Good evening, I'm trying to make a single php page wich can edit/delete multiple
Good evening, I would like to have a navigation bar which is centralised to
Good evening, I made a well working function with php, mysql and ajax. A
Good evening, I must make an intranet with Liferay, the most important is to
Good evening everybody! I'm stuck at writing my own email program in php for
Good evening. I recently bump into the filter_var() of PHP. I am wondering if
good evening, i need to check if the input match my regex or not
Good evening, I created a class which inherits from UIViewController and i created a
Good evening everyone! I am working on learning some java and I have made
good evening everone , i have phpmailer code which allow me to connect to

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.