JSFiddle - React, Tailwind, and code Playground

JavaScript

var str = 'Hello World http://example.com/?param=FooBar Foo Bar';

document.body.innerText = str.replace(/[^\s]+/g, function (match) {
    return match.indexOf('http') === 0 ? match : match.toLowerCase();
})