JSFiddle - React, Tailwind, and code Playground
HTML
<span class="honorpoints">UserA: 234</span>
<span class="honorpoints">UserB: 600</span>
JavaScript
$(".honorpoints").each(function(){
$(this).text(function(i, text) {
return text.replace(/\d+$/, function(match) {
if(match >= 1 && match <= 500) return "rank 1";
else if(match > 500 && match < 3000) return "rank 2";
});
});
});