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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T23:03:47+00:00 2026-05-31T23:03:47+00:00

How do I turn this text: • Ban Ki-moon calls for immediate ceasefire• Residents

  • 0

How do I turn this text:

• Ban Ki-moon calls for immediate ceasefire• Residents targeted in
al-Qusayr, witnesses tell HRWIsrael ignoring expanding violence by
settlers, EU reports9.18am: Footage from activists suggests that
opposition forces continue to resist government troops.This footage…

into this text:

Ban Ki-moon calls for immediate ceasefire. Residents targeted in
al-Qusayr, witnesses tell HRW. Israel ignoring expanding violence by
settlers, EU reports. 9.18am: Footage from activists suggests that
opposition forces continue to resist government troops. This
footage…

This needs to be fixed with javascript (multiple .replace commands are possible)

  1. “• ” has to be removed and replaced by a “. “, however the first “• ” should just be removed
  2. If there is no space after a dot “.”, a space must be added (.This footage)
  3. If there is no space before a time (9.18am), a space must be added
  4. If there is no space before a capital letter (HRWIsrael) that is
    followed by non-capital letters, then a dot and space “. ” must be added in front
    of that non-capital letter.
  • 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-31T23:03:48+00:00Added an answer on May 31, 2026 at 11:03 pm

    Breaking down into several replace statements (as listed below) is the way I would go about it (working fiddle).

    The fixBullets function will turn all bullets into HTML Entities and the fixBulletEntities fixes those. I did this to normalize bullets as I’m not sure if they are just bullet characters or HTML entities in your source string.

    The fixTimes function changes “9.18am:” into ” 9:18am. ” (otherwise, the fixPeriods function makes it look like ” 9. 18am” which I am sure you do not want.

    One major caveat regarding the fixCapitalsEndSentence function… This will also convert strings like “WOrDS” into “WO. rDS” which may not be what you want.

    At the least, this should get you started…

    function fixBullets(text) {
        var bullets = /•/g;
        return text.replace(bullets, '•');
    }
    
    function fixBulletEntities(text) {
        var bulletEntities = /•/ig;
        text = text.replace(bulletEntities, '. ');
        if (text.indexOf('. ') === 0) {
            text = text.substring(2);
        }
        return text;
    }
    
    function fixTimes(text) {
        var times = /(\d+)[\.:](\d+[ap]m):?/ig;
        return text.replace(times, ' $1:$2. ');
    }
    
    function fixPeriods(text) {
        var periods = /[.](\w+)/g;
        return text.replace(periods, '. $1');
    }
    
    function fixCapitalsEndSentence(text) {
        var capitalsEndSentence = /([A-Z]{2,})([a-z]+)/g;
        text = text.replace(capitalsEndSentence, function(match1, match2, match3) {
            var len = match2.length - 1;
            var newText = match2.substring(0, len) + '. ' + match2.substring(len, len + 1) + match2.substring(len + 1) + match3;
            return newText;
        });
        return text;
    }
    
    function fixMultipleSpaces(text) {
        var multipleSpaces = /\s+/g;
        return text.replace(multipleSpaces, ' ');
    }
    
    function fixAll(text) {
        text = fixBullets(text);
        text = fixBulletEntities(text);
        text = fixTimes(text);
        text = fixPeriods(text);
        text = fixCapitalsEndSentence(text);
        text = fixMultipleSpaces(text);
        return text;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How do I turn this: <a class=link> <p class=paragraph>This is some text</p> <p class=paragraph>This
I want to turn this text: She's saying it's time to 'find a solution'.
I'm trying to turn this text: She’S Saying It’S Time To 'Find A Solution'
I am trying to turn this text: ×וויר. ××¢×ª×™× ×©×œ רשתות חברתיות ו×תקשורת של×
How do I turn this into a live jquery toggle (coffeescript)? $('.link').toggle( -> $(this).text('less');
How to turn this into a plain text email? $bound_text=md5(uniqid(time())); $headers.=MIME-Version: 1.0\r\n . Content-Type:
According to the Bourbon docs , you can use #{$all-text-inputs} to turn this: #{$all-text-inputs}
How do I turn this, which uses two calls two children : $('#id tr').children('td').children('input')
I'm trying to turn this XML string into a select I have @Schedule XML
I want to turn this (Mitarbeiter.csv): Max;Mustermann;02.03.1964;501;GL;Prokurist Monika;Mueller;02.02.1972;500;Sek;Chefsekretaerin Michael;Maier;06.07.1985;617;Aquise;- into this (header-content.html): <tr><td>Max</td><td>Mustermann</td><td>501</td></tr> <tr><td>Monika</td><td>Mueller</td><td>500</td></tr>

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.