I searched a lot ,and unable find to detect for loop that is inside my variable ;
I have a String like : "for(i=0;i<=1000;i++)" or it may be any kind of for loop !
I want to get first part of for loop : like for(i=0; and 1000 that how many times it run if digit is given. 
I used for now that give me first part but it is not perfect :
 str.replace(/for\(\w+=\w;/g,"something");
it fails when i put some space in between!
Is it any way to get only the part of for loop Using regEx ??
 
     
    