John Weiss
Coder
Trying to get all delimited items in a string.
Here's the code:
I expect to get array ["{{HELLO}}", "{{WORLD}}"]
Not getting any results.
also posted here:
forum.freecodecamp.org
www.sitepoint.com
Here's the code:
JavaScript:
const myString = "abc{{HELLO}}defg{{WORLD}}"
const templateFieldsRegex = /\{\{\w+\}\}/g
const templateFields = myString.matchAll (templateFieldsRegex)
I expect to get array ["{{HELLO}}", "{{WORLD}}"]
Not getting any results.
also posted here:
Reg Exp Not Working with matchAll
Trying to get all delimited items in a string. Here’s the code: const myString= "abc{{HELLO}}defg{{WORLD}}" const templateFieldsRegex = /\{\{\w+\}\}/g const templateFields = myString.matchAll (templateFieldsRegex) I expect to get array [“{{HELLO}}”, “{{WORLD}}”] Not getting any results...
forum.freecodecamp.org
Reg Exp Not Working with matchAll
Trying to get all delimited items in a string. Here’s the code: const myString = "abc{{HELLO}}defg{{WORLD}}" const templateFieldsRegex = /\{\{\w+\}\}/g const templateFields = myString.matchAll (templateFieldsRegex) I expect to get array [“{{HELLO}}”, “{{WORLD}}”] Not getting any results...
www.sitepoint.com