node.js - JavaScript/Node match returns null -
i want out of string containing html code, 1 value. therefore trying following:
var test = '<div class="market_listing_largeimage"><img src="someurlhere" alt="" /></div>'; var test2 = test.match('<div class="market_listing_largeimage"><img src="' + '(.*)' + '" alt="" /><</div>');
my problem returns null. googling last hour, trying different examples, worked string provided in example, somehow, doesn't work me. doing wrong?
you have additional <
in code.
this should work:
var test = '<div class="market_listing_largeimage"><img src="someurlhere" alt="" /></div>'; var test2 = test.match('<div class="market_listing_largeimage"><img src="' + '(.*)' + '" alt="" /></div>');
Comments
Post a Comment