JSFiddle - React, Tailwind, and code Playground

by eapo

HTML

<div class="offerdescription clr" id="offerdescription">
                                <div class="offer-titlebox">
                        <div class="offer-titlebox__social">
                <a href="#" class="{id:207740659} observe-link offerobserve" data-cy="adpage_observe_star" data-statkey="ad.observed.bigstar" title="Salveaza ca favorit">
                    <span class="inlblk icon observe4 observed-207740659" data-icon="star"></span>
                </a>
                <a href="https://www.facebook.com/sharer/sharer.php?u=https://www.olx.ro/oferta/laptop-lenovo-thinkpad-t-480-s-8-gb-IDe3EPN.html" onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=300,width=600');return false;" target="_blank" class="offer-titlebox__btn-social-share"></a>
            </div>
                <h1>
        Laptop Lenovo Thinkpad T 480 S 8 GB    </h1>
    <div class="offer-titlebox__price">
        <div class="pricelabel">
		<strong class="pricelabel__value not-arranged">2 900 lei</strong>
			</div>

    </div>
    <div class="pricecredit">
                </div>

    
            <div></div>    
    <div class="offer-titlebox__buttons">
    <a rel="nofollow" href="https://www.olx.ro/bundles/promote/?id=207740659&amp;bs=adpage_promote" class="olx-vas-button olx-vas-button--promote">
        Promoveaza anuntul    </a>
    <a rel="nofollow" id="pushUpPromoteAd" href="https://www.olx.ro/bundles/refresh/?id=207740659&amp;bs=adpage_pushup" class="olx-vas-button olx-vas-button--refresh">
        Actualizeaza anuntul    </a>
            <div></div>        <div></div>    </div>

</div>

                                <div class="clr descriptioncontent marginbott20">
                                    
<ul class="offer-details">
							<li class="offer-details__item">
														<a href="https://www.olx.ro/electronice-si-electrocasnice/laptop-calculator/laptop-uri/cluj-napoca/?search%5Bprivate_business%5D=private"...

JavaScript

var string = "This is a test string";
string += "\r\n";
string += "with second line";
var matchArr = [];
var srch = prompt(".match(%)", "(.*)test(.*)|sec");
var regx = new RegExp(srch, "ig");
matchArr.push(string.match(regx));
console.log(matchArr);


.forEach(company => {
	console.log(company);
});