I’m searching for a JavaScript Regex replace in one “command”.
It should replace asterisks within four brackets (two on each side) with the HTML charcode ★ (★) within a span class=”stars”. There is a minimum of 1 and a maximum of 5 asterisks.
The replace is applied to a large text, so multiple replaces should function.
Example:
{{*}}
{{**}}
{{***}}
{{****}}
{{*****}}
should be replaced by:
<span class="stars">★</span>
<span class="stars">★★</span>
<span class="stars">★★★</span>
<span class="stars">★★★★</span>
<span class="stars">★★★★★</span>
Not really one line, but this works