Why is this giving me null
?
<script language="javascript">
var element = "11";
var string = "7,11";
var check = string.match("/(^|\D)"+element+"(\D|$)/g");
alert(check);
</script>
When I run the regex
on http://regex.larsolavtorvik.com/ it works correctly.
Pleeeease help I want to sleeeep! :))