RegexpGarden














- Garden Text Representation
12345678
let garden = [ "Apple 'Gala Must 696'", "Rosemary", "Corn 'Pioneer 3751'", "Christmas Rose", "Snow-on-the-Mountain", "Wheat 'Norin 10'", "Rose-of-Sharon"];- Code Editor
- Log
123456
for (const plant of garden) {if (plant.match(//i) {cut(plant);}}Lesson task •
Cut plants which names doesn't contain "'" and no digits
Single character not from a custom symbol class
[^...] again
Matches single character NOT from the specified range of symbolsNow we can craft the rest of predefined symbol classes from the previous lessons:
- \W equals to [^A-Za-z0-9_]
- \S equals to [^ \t\n\r\f]
- \D equals to [^0-9]
