I have got:
var myclass = 'moreElements showAddElements-570';
var re = new RegExp('showAddElements\-\d*');
var m = re.exec(myclass);
alert(m[0]);
alert(m[1]);
First alert results in 'showAddElements-', second alert in 'undefined'. I would like to get '570', what I am doing wrong here? If I test it, I get there at least 'showAddElements-570' ... what am I doing wrong here?
Thx for any tipps!
P.s.: I'd like the number only after 'showAddElements-', all other numbers should be omitted..