Is it possible to get numbers within brackets from string with RegEx? For example, I have selects with content like:
<select class="selectoption">
<option value="1">no numbers</option>
<option value="2">3 (+110.0 грн.)</option>
<option value="3">Blabla (+95.5 грн.)</option>
</select>
I need to get only numbers, when user select option with brackets (110 or 95.5).
Now I have:
$('.selectoption').change(function() {
if ( $("select option:selected").text().match(/\(.*\)/).length ){}
alert (
$("select option:selected").text().match(/\(.*\)/)
);
end
});
But it returns (+110.0 грн.) :(
liveis deprecated. Just so you'll know.