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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T18:51:58+00:00 2026-05-14T18:51:58+00:00

I was hoping to get a nice push in the right direction I would

  • 0

I was hoping to get a nice push in the right direction I would like to change the ending of my images sources string… i hope i worded that right.

Anyway my current src’s are reading:

<img src="something/something/12345_m.jpg" />

I would like to change it to:

<img src="something/something/12345_t.jpg" />

Any idea guys…Thanks!

  • 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-14T18:51:59+00:00Added an answer on May 14, 2026 at 6:51 pm

    This one is a bit safer:

    $('img').each(function () {
        var src = $(this).attr('src');
        $(this).attr('src', src.replace(/_m(\.[^.]+)?$/, '_t$1');
    });
    

    Else you may risk URL’s like /bat_man/images/oh_my_god_m.png to end up as /bat_tan/images/oh_my_god_m.png when using eKek0’s answer.


    Explanation of the regex /_m(\.[^.]+)?$/:

    • /.../ are just pattern borders.
    • _m matches literal _m.
    • (...) match grouping, the first one ends as $1 in result.
    • \. matches literal .. Because . is a special char in regex, it’s escaped by \.
    • [...] represents group of characters.
    • ^. matches everything but literal .. Because it’s inside a group, escaping is not needed.
    • + matches one or more characters.
    • ? previous group is optional (for the case that there’s no file extension).
    • $ match must occur at end of string (and thus not in the middle or so).
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem that I'm hoping to get some direction in solving -
In Eclipse, when I search a project for a string, I get a nice
I was hoping to get some help with my SQL Server script. Basically, I
I was hoping to get some advice on what to do. I have a
I am fairly new at developing for Android and was hoping to get some
I have a small problem that I am hoping to get some help with.
I'm not massively familiar with this design but I am hoping to get some
I've looked up a couple of documents but I was just hoping to get
I'm not a UI person, so I'm hoping to get some suggestions for how
Was hoping I could get a bit of a hand on this login 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.