Exists such a Javascript code:
var re = /some_regex/g;
return re.exec(link.attr('href'))[0]
How to call this in CoffeeScript In CoffeeScript there is no need in brackets for parameters but there is another call of function in param.
I've tried:
re = /some_regex/g
re.exec link.attr 'href' [0] # compile error: unexpected [
re.exec (link.attr 'href')[0] # javascript: re.exec((link.attr('href'))[0]);
re.exec (link.attr('href'))[0] # javascript: re.exec((link.attr('href'))[0]);
how to do this? or I should make
// adding new variable
temp = re.exec link.attr 'href'
temp[0]