RegexpGarden








- Garden Text Representation
1
let garden = ["Rose", "Rue", "Rice", "Rye"];- Code Editor
- Log
123456
for (const plant of garden) {if (plant.match(//i) {fertilize(plant);}}Lesson task •
Fertilize "Rye" and "Rue" but not the other plants
Any single single character
.
Matches any single symbolTo write a pattern with a "gutshot" where can stand any symbol use . token:
123
console.log(!!"bar".match(/ba./)) // true console.log(!!"baz".match(/ba./)) // true console.log(!!"foo".match(/ba./)) // false 