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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T14:30:29+00:00 2026-05-22T14:30:29+00:00

Hey guys, I hope I am able to explain this as easy as possible.

  • 0

Hey guys, I hope I am able to explain this as easy as possible. Basically I am compiling a list and to do so I need to remove a load of text after a certain trigger word.

Example of what I am trying to achieve is here

Say I have just pasted a bunch of text in my text box, I want everything removed apart from the first username.

And example would be…

r-u-f-f-i-a-n reblogged this from youaref0rsaken

youaref0rsaken reblogged this from loveeoutoflust

loveeoutoflust reblogged this from yourwatchfuleye

Which I would want to turn in to

r-u-f-f-i-a-n

youaref0rsaken

loveeoutoflust

With using a textbox with the input, a button and a textbox which would display the output. I have tried doing this using jquery and php preg_replace but cannot get it to function correctly.

Is anyone able to help me with this?

  • 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-22T14:30:29+00:00Added an answer on May 22, 2026 at 2:30 pm


    look into javascripts replace funciton

    string.replace(regexp/substr,newstring)
    

    as an example check out this fiddle using the code below http://jsfiddle.net/vwhCx/
    note: if the concept of a regexp is new to you the only thing to know here: /reblogged this from/g is that the //g means globeably, or more than one match.

    <div id="boxy-1"> r-u-f-f-i-a-n reblogged this from youaref0rsaken youaref0rsaken reblogged this from loveeoutoflust loveeoutoflust reblogged this from yourwatchfuleye </div>
    
    <button>transform</button>
    <script type="Text/javascript">
    $(document).ready(function() {
      $('button').click(function() {
        //get text from box
        var str = $('#boxy-1').text()
        //empty box
        $('#boxy-1').empty();
        //insert formatted sting 
        $('#boxy-1').append(str.replace(/reblogged this from/g, ' '));
      });
    )};
    
    </script>
    

    UPDATE

    based on your comment I have altered my code to work on a text area

    use this

    <textarea id="boxy-1"> r-u-f-f-i-a-n reblogged this from youaref0rsaken youaref0rsaken reblogged this from loveeoutoflust loveeoutoflust reblogged this from yourwatchfuleye</textarea>
    
    <button>transform</button>
    
    <script type="text/javascript">
    $(document).ready(function() {
      $('button').click(function() {
        //get text from box
        var str = $('#boxy-1').text()
        //empty box
        $('#boxy-1').empty();
        //insert formatted sting 
        $('#boxy-1').val(str.replace(/reblogged this from/g, ' '));
     });
    });
    

    new live example: http://jsfiddle.net/K3LZU/

    LAST EDIT

    if you are trying to display it as a list, or newlines try str.replace(/reblogged this from/g, ‘\n’) the \n indicating a newline

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

Sidebar

Related Questions

Hey guys, hope this isn't too much of a n00b question I'm mainly a
Hey guys, I want to store a categorized list of URLs. This is an
Hey guys I want to be able to replace a tuple in a list
Hey guys, I'm working on a project. I need to use the function cvFindHomography
Hey Guys, here is my code for this, the only help i get from
Hey guys. I'm not much of a programmer, but still need to do some
Hey guys, take a look at this, maybe you can help me. This code
hey guys how to make these php html links codes possible. i have tried
hey guys I have the follow code in js: $(document).ready(function(){ $(.replyLink).click(function(){ $(#form-to-+this.id).html(htmlForm()).toggle(500); return false;
Hey guys I have about 8 fieldSets and Im iterating over a list. I

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.