JSFiddle - React, Tailwind, and code Playground
JavaScript
var myclass = 'moreElements showAddElements-570';
var re = /showAddElements-(\d+)/;
var m = re.exec(myclass);
alert(m[0]);
alert(m[1]);
var myclass = 'moreElements showAddElements-570';
var re = /showAddElements-(\d+)/;
var m = re.exec(myclass);
alert(m[0]);
alert(m[1]);