need help in understanding javascript code
Can anyone explain me the fo开发者_如何学JAVAllowing piece of code
sampleQuery.replace(new RegExp("("+query+")","ig")
What is this "ig" stands for?
the i and the g are flags used with Regular Expressions: 
g - 'global' matching - ie. gets all matches (the default behaviour is to stop after one match is found. http://www.w3schools.com/jsref/jsref_regexp_g.asp
i - makes the matches case-insensitive. http://www.w3schools.com/jsref/jsref_regexp_i.asp
hth.
 
         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论