Regex Coding Tutorial, Match Non-Whitespace Characters, Tutorial on Regular Expressions

Lesson Summary

In this regular expression lesson from freeCodeCamp, we take a look at the opposite of \s (which finds whitespace for us), and instead, we use \S to get a single match on anything but whitespace in a string. For our challenge, we also apply the "g" flag in order to return all non-whitespace characters in a string. Utilizing \S helps us exclude all whitespace from being matched similar to using the character class [^\r\t\f\n\v]. The difference is that this way is shorter and easier to read but will do the same thing as the long hand version. Buy a Cool Super Hero Sticker for yourself and support us! https://BelieveRationally.com/Shop See this course and many more free online coding courses at https://wewillcode.com Vibe out to some music I created at https://ananomyx.com Check bae's epoxy resin craft store at https://valeryedoesresin.com

Subscribe To Monthly Newsletter. Chance to Win Monthly Prizes

* indicates required