replace2 [javascript] replace with Regex, $n vs $& The $& and $1 are not the same. $& is a back reference to the whole match. $1 is a back reference to the submatch captured with capturing ref 2023. 5. 9. [Javascript][Regex] Regex test does not select all items from a list [javascript] RegEx g flag test flag: g >> remember lastIndex /c/ig.test('ccc') // true /c/ig.test('ccc') // false // vs /c/i.test('ccc') // true /c/i.test('ccc') // true Don’t use g if you want to test several times Or Before another test, you should make test return false 시나리오 Senario I want to get all items that contains my search words. I used Regex test to fil.. 2022. 8. 22. 이전 1 다음