jeudi 12 février 2015

why this regexp returns match?


http://ift.tt/1zbhuZf



var reg = /^(?!managed).+\.coffee$/
var match = '20150212214712-test-managed.coffee'.match(reg)
console.log(match) // prints '20150212214712-test-managed.coffee'


I want to match regexp only if there is not word "managed" present in a string - how I can do that?





Aucun commentaire:

Enregistrer un commentaire