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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T19:09:36+00:00 2026-05-23T19:09:36+00:00

I have a webpage where I want to replace all standard quote characters with

  • 0

I have a webpage where I want to replace all standard quote characters " with the nicer looking quotes. For example, we have

"hello world"

which would be replaced with

“hello world”

in markup, showing the much better looking ‘curly’ quotes.

The two HTML special characters are pairs, in that they “open” and “close” a quote block, instead of being a generic double dash, which is where I’m struggling – simply replacing all quotes with “ is easy, but I want to do it so the open/close pairs are respected.

  • 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-23T19:09:36+00:00Added an answer on May 23, 2026 at 7:09 pm

    I might be missing something obvious here, but I think the following RegEx solution would work –

    subject = 'test "abc" test "abc"';
    result = subject.replace(/"([A-Za-z ]*)"/ig, "“$1”");
    alert(result);
    

    If you were using PHP then you could write some similar code in PHP – (my PHP skills are somewhat lacking though! The code below was generated with RegEx Buddy so it hasn’t been tested and may need changing)

    $subject = 'test "abc" test "abc"';    
    $result = preg_replace('/"([A-Za-z ]*)"/i', '“$1”', $subject);
    

    Alternatively, you could load the content into a DIV using PHP then use JavaScript to change the DIV contents, here’s a bit of JQuery that would do the job –

    $("#contentdiv").text($("#contentdiv").text().replace(/"([A-Za-z ]*)"/ig, "“$1”"));
    

    There’s a jsfiddle that demonstrates the above JQuery here.

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

Sidebar

Related Questions

I have webpage with a large height attribute which displays products. I want the
i have a webpage including 4 different iframe webpages i want that all pages
I have a webpage where I want the user to see a new image
I have a webpage that displays a calendar, and I want to change the
Basically i have a webpage with embedded css and JavaScript, so what i want
I have a very AJAX-ish listing webpage created using Codeigniter where I want registered
i have a username textbox and a password textbox in the webpage. i want
I would like to replace text with image, but I want also to have
I have a web page. From that i want to find all the IMG
I have now some question about hiding some characters ... I want to hide

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.