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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T21:26:31+00:00 2026-05-23T21:26:31+00:00

I try a regex, but the result is not really that I want. This

  • 0

I try a regex, but the result is not really that I want.

This is my regex :

/^(([a-z]{0,})([0-9]+)).*/i

And this is my strings :

8500A.JPG //I need to get 8500A but I get 8500
0130799.JPG // I get the good result : 0130799

How to keep alphabetical characters before the .JPG ?

  • 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-05-23T21:26:31+00:00Added an answer on May 23, 2026 at 9:26 pm

    Looks like you may have been getting enclosing parenthesis confused.

    inside the character class you can specify many ranges

    /^([0-9A-Za-z]{0,})\.JPG$/
    

    To break down what it is doing:

    • ^ = start of line
    • $ = end of line
    • (…) = $1 will get anything in here
    • [A-Za-z0-9] = match anything between A-Z, between a-z and between 0-9
    • {0,} = 0 or more times
    • . = escape so you use a literal “.”

    More info here:
    http://www.regextester.com/pregsyntax.html

    Hope that helps

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

Sidebar

Related Questions

I do not not know much about Regex, I want to try parsing sting
I'm trying to make a Regex that matches this string {Date HH:MM:ss}, but here's
I made this many times and it worked, but not this time. I get
To see what I want, check out the regex I'm using. I'll try to
I'm not sure what exactly i'm doing wrong here...but i noticed that my File.Move()
i want to get the google results as div. but i take error Object
I bust my head but can not sort this out. numbers, names are fictional.
I'm not typically a web developer, but I'm a decent enough coder that I
I'm using this regex to find a String that starts with !?, ends with
I have .Net Regex ([abc][e])+([abc]) but when I try to match, it matches only

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.