Find More Than the First Match, freeCodeCamp's Regexes Tutor, Regular Expression Help 2020

preview_player
Показать описание
In this lesson, we continue looking at regexes. In previous lessons, we learned how to see whether a pattern exists within a string by using the .test method, and we also learned about the .match method which allows us to return a pattern when it is found. Flags have also been explained in previous tutorials, and today we look at finding and returning every time our pattern is found using the "g" flag. The "g" flag for a regular expression allows us to find every instance of our pattern within some text, not just the first time it is found. We are able to combine this flag with the "i" flag we recently learned to ignore casing. If we combined both flags we would essentially be returning all instances of a pattern found regardless of casing.
Рекомендации по теме
Комментарии
Автор

Your screen shots are excellent(no eye strain) and your teaching style is clear and concise. Thanks a lot for posting.

mikecurtis
Автор

Thank you for your videos without mistakes, because when people are doing coding with mistakes it just throws me off. I'm sure there are mistakes but for a greenhorn there I just get thrown off the boat when mistakes happen

veriitas