RegexpGarden










- Garden Text Representation
123
let garden = "Rose\tBlackberry\tRose\tBlackberry\tRose";- Code Editor
- Log
123456
garden = garden.replace(//i, "Blackberry");Lesson task •
Replace the first rose with blackberry.
Attention: now you are working with the garden written in a string with tabulation symbol delimitersflag g
Replaces all the matches, not only the first matchWhen replacing with regular expressions, by default regular expressions replaces only the first match:
1
console.log("foo foo foo".replace(/foo/i, "bar")) // bar foo foo 