I am trying to take input from the textbox now I want to show an alert if the textbox value matches with the regular expression.
I want to check "1702, Belgium" or "Belgium, 1702" using regex but I am getting null.
<script>
$(document).ready(function(){
var r =/+{1702}/;
var v=$(".a").val();
alert(v.match(r));
});
</script>
<body>
<input type="text" class="a" value="1702 Belgium"/>
</body>