I am clueless about regular expressions, but I know that they\'re the right tool for what I\'m trying to do here: I\'m trying to extract a numerical value from a string like thi
Try something like this:
/\^assignment_group=(\d*)\^/
This will get the number for assignment_group
.
var str = 'approval=not requested^assignment_group=12345678901234567890123456789012^category=Test^contact_type=phone^',
regex = /\^assignment_group=(\d*)\^/,
matches = str.match(regex),
id = matches !== null ? matches[1] : '';
console.log(id);