I have a javascript code, and I wanna get a specific function. my code is working well, but I have a problem how to get just the first corresponding of a string. in my example it is 'false', here is the javascript code : 'the code is not 100% correct , just an example.'
$(document).ready(function() {
$('#flash').insertAfter($('.report-header'));
$('a.bounce-tip').tooltipster({interactive: true, position: 'top', trigger: 'click'});
$('#add-manual-rejection').dialog({
autoOpen: false,
resizable: false,
width: 400,
modal: true
});
$('#add-blacklist-show').click(function() {
$('#add-manual-rejection').find('input[name=address], input[name=comment]').val('');
$('#add-manual-rejection').dialog('open');
return false;
});
$('#cancel-add-rejection').click(function() {
$('#add-blacklist-show').click(function() {
$('#add-manual-rejection').find('input[name=address], input[name=comment]').val('');
$('#add-manual-rejection').dialog('open');
return false;
});
return false;
});
});
and Now my regex is :
/([\(\'\$\#]+add-b[\w\W]+false)/
I also tried to use {1,2,etc....} to get the first result. so it became like this :
([\(\'\$\#]+add-b[\w\W]+false{1})
But in this case the interpreter give the result just for the last letter which is 'e' not for the whole word.
I am using this website to match my regex : http://rubular.com/
any advices !? thanks :)