Q:

How to remove all text except one with starts with some word?

im trying to remove all text except one in javascript
the idea is do something like 
//jQuery("someelement").attr("class"); 
var classes=  "cnode_1 timestamp_1413504000 item"; 

classes = classes.replace(/^(?!timestamp_)/,'');

i want to take only the text who starts with timestamp_, the expected ouput is :
timestamp_1413504000

i want this , then to grab the number 
//now "classes" show be timestamp_1413504000
classes = classes.replace("timestamp_","");

the expected ouput is :
1413504000

i want to avoid use something like, split the clasess base on space, then use for bucle, and finally compare with indexOf

A:

Do you need the "timestamp_" for something?
Why not just
= classes.replace(/^.*timestamp_(\d+).*/img, "$1");

