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

  • Home
  • SEARCH
  • 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 8662733
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T16:48:15+00:00 2026-06-12T16:48:15+00:00

I hope you can help me create a regex that will extract the image

  • 0

I hope you can help me create a regex that will extract the image name from a url. I’ve been trying to create the regex for a couple of days now but i cant get it to work.

The case:
I have an image url created with phpThumb that looks like this:
\bla\thumb\phpThumb.php?src=/bla/images/thisistheimage.jpg&fltr[]=wmt|40|B|FFFFFF|georgia.ttf|35&hash=b7412f04f09cd6b488435231651d61453

No i need the following extracted: thisistheimage.jpg

Some facts:

  • there is always a “/” in front of the image name;
  • the image name is always followed by an amp (&);
  • the image extention can also be: jpeg, JPG, png, PNG, gif;

All i have managed to grab was the image extension with (?:png|jpg|gif).

Can you please help me what regex I have to use in this case?

I’m able to use the regex in javascript or in PHP, where do you recommend it? (I use javascript to submit the form and the form action is done in PHP).

  • 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-12T16:48:16+00:00Added an answer on June 12, 2026 at 4:48 pm
    /\/([A-Z0-9_-]{1,}\.(?:png|jpg|gif|jpeg))/i
    

    I think that should work. i flag for insensitive case

    • matches slash /
    • Alphanumeric, , and – one or more [A-Z0-9-]{1,}
    • period .
    • extension (?:png|jpg|gif|jpeg)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I hope someone can help with the following. I'm trying to create a user-specific
I hope somone can help me with a problem I been trying to deal
I hope you can help me. I have a web service that needs to
I hope you can help. This has been confounding me for hours. I have
Hope someone can help me as I've been searching for hours. I'm planning on
Hope someone can help me with this issue. I'm trying to open an info
I hope someone can help me out. I have a table that logs our
hope everything's great with everyone. can someone please help me to create regexp to
I hope somebody can help me here, I have a table that has the
I hope someone can help with this. I have created a map app that

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.