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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T01:54:09+00:00 2026-06-10T01:54:09+00:00

I have a html which looks roughly like this <div id=wallPostTemplate> <li id=’comment-content–oOo-id-oOo-‘ class=’comment-content’

  • 0

I have a html which looks roughly like this

<div id="wallPostTemplate">
    <li id='comment-content--oOo-id-oOo-' class='comment-content' comment_id='-oOo-id-oOo-'>
        <a class='comment-avatar' href='-oOo-link-oOo-'>
            <img class='small_avatar' src='<?="../" . MESTO_ZA_UPLOAD_FAJLOVA_KORISNIKA ?>-oOo-korisnikPodaci.Slika-oOo-'></a> 
            -oOo-text-oOo-
    </li>
</div>

Now I get the contents of the html into a sting with $('#wallPostTemplate').text() and then I want to replace dynamically the occurrences of the string -oOo-id-oOo-
with whatever data I have stored inisde a variable like -oOo-id-oOo-, -oOo-text-oOo- and so on…

Now I tried numerous ways to tackle this thing but I always end up without a solution.
Here is my latest try out. HELP pls Q_Q

var regex = new RegExp('{\-oOo\-'+index+'\-oOo\-}', "g");
post = post.replace(regex, value);  

Also I tried str.replace but it does not work… It seems new lines are the problem but I have no idea how to over come this…..

edit:

To make it more simple to understand i made a example on jsfidle: http://jsfiddle.net/DdBFB/
And as you can see, you can see nothing…. it dous not work when you get the content over the html function.

  • 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-10T01:54:11+00:00Added an answer on June 10, 2026 at 1:54 am

    Although your question is not really clear I’ve whipped up an example that replaces a value based on a regular expression.

    var source = "-oOo-korisnikPodaci.Slika-oOo-";
    var id = "korisnikPodaci.Slika";
    var regex = new RegExp('\-oOo\-' + id + '\-oOo\-', "gmi");
    
    // Match
    source.replace(regex, "hello world"); // => "Hello World"
    
    // Mismatch
    source = "-oO!!!o-korisnikPodaci.Slika-oO!!!o-";
    source.replace(regex, "hello world"); // => "-oO!!!o-korisnikPodaci.Slika-oO!!!o-"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a HTML code which looks like this. <html><head><meta http-equiv=refresh content=0;url=http://www.abc.com/event/></head></html> I want
I have a piece of piece of HTML which looks like this - <div
I have a html which looks roughly like this: <tr id=row> <td id=cell_1>Cell 1</td>
I have some html which looks like this: <div style={ display:inline; width: 80px}>fig</div>vitamin c<br>
I have html which looks somethine like this <div class=portlet portlet_30> <div class=portlet_header portlet_header_30>
I have some HTML which looks like this: <body> <div id=panel1 class=panel> Panel 1
I have a table which looks like this (in html): <div id=product_grid_one> <table> <tr>
I have a webpage with a form, which looks kinda like this: @using (Html.BeginForm(MyAction,
I have a composite control which emits HTML that looks like this <span id=myControl>
I have an index.html file which looks like this (the rest is omitted), <ul

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.