RegExp: find the square bracket "[" if the word "foo" is not in front of it?
bar[ <--- это найти foo[ <--- а это не надо Thank!
RegExp: find the square bracket "[" if the word "foo" is not in front of it?
bar[ <--- это найти foo[ <--- а это не надо Thank!
The regular expression will be like this
^(?!foo).*\[ On JS will be like this
var regexp = new RegExp("^(?!foo).*\\["); var string = 'bar['; console.log(string.search(regexp)); var string = 'afoo['; - zb 'Source: https://ru.stackoverflow.com/questions/662709/
All Articles