December 7th, 2009, 01:48 PM
Extracting string and removing it and it's wrapper
var x = "(EVAL)(H:somestring)Some other Text here";
var full =(x.match(/\(H\:(.*?)\)/g));
var inside = (x.match(/\(H\:(.*?)\)/g)); // not sure how
January 6th, 2010, 02:41 PM
This looks like a job for groups.
Groups let you wrap parts inside of your regex pattern in parenthesis, and extract them as "groups". For example, you could have a regex to match a 10 digit phone number, and have a group inside to also extract the area code.