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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:11:37+00:00 2026-05-26T22:11:37+00:00

last_tag=abcde x; last_tag = last_tag.replace(/[\s]+x$/, ”); this is my problem: i have to remove

  • 0
last_tag="abcde   x";
last_tag = last_tag.replace(/[\s]+x$/, '');

this is my problem: i have to remove an “x” at the end of my string. This piece of code is used in a plugin i’ve been using without problems until now. On IE 7 “last_tag” is selected in the wrong way, so i get an “x” and i have to remove it. I think who wrote the plugin added this replace to do exactly this but it’s not working on IE7.

Example:
before:last_tag=”abcde x”
after: last_tag=”abcde”

Actually the problem is that last_tag remain exactly the same.

is the regex correct? is there any error or compatibility issue with IE?

EDIT: Probably the regex is not the issue.

I’ve tried this piece of code, but nothing happens:

var temp_tag="abc x";
alert(temp_tag);
temp_tag = temp_tag.replace(/[\s]+x$/, '');
alert(temp_tag)

The same piece of code work perfectly on Chrome.

  • 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-26T22:11:38+00:00Added an answer on May 26, 2026 at 10:11 pm

    The regex looks okay, but it’s possible you’re trying to match non-breaking spaces (U+00A0). \s doesn’t match those in IE (as explained in this answer), but it does in FireFox and Chrome.

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

Sidebar

Related Questions

If I have some html in my editor like this: <p>Some code here.</p></This needs
I am using this plugin for hovercards..http://designwithpc.com/Plugins/Hovercard The problem with this plugin is when
how can I fix this problem on Internet Explorer 7: If I resize the
There seems to be a problem with the JS Code for Opera browsers, as
I have the following sample template code. {# @T('core.layout:Logged in as {0} {1}', @user('firstname'),
I have the following mark up <ul> <li>this is bullet list</li> <li>this is another
I have the following code, and it's giving me a parse error when run.
I have the following code: var tagToPosts = (from t2p in dataContext.TagToPosts join t
given the following string: var htmlStr = '<p class=red_349dsa01>This is</p><p class=blue_saf9vsaz>a test</p>'; how can
I have php file, and I want to remove closing tag (?>), but 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.