#box2) and I just want the
2 from it.
var thestring = $(this).attr('href'); var thenum = thestring.replace( /(^.+)(wd+w)(.+$)/i,'$2'); alert(thenum);
It still returns
#box2 in the alert, how can I get it to work?
It needs to accommodate for any length number attached on the end.