Explore our extensive collection of courses designed to help you master various subjects and skills. Whether you're a beginner or an advanced learner, there's something here for everyone.
For all the self-taught geeks out there, here is our content library with most of the learning materials we have produced throughout the years.
It makes sense to start learning by reading and watching videos about fundamentals and how things work.
Full-Stack Software Developer - 16w
Data Science and Machine Learning - 16 wks
Search from all Lessons
Curated list of small interactive and incremental exercises you can take to get better at any coding skill.
Curated section of projects to build while learning with simple instructions, videos, solutions, and more.
Guides on different topics related to the technologies that we teach in our courses
Every week, we pick a real-life project to build your portfolio and get ready for a job. All projects are built with ChatGPT as co-pilot!Start the Challenge
A tech-culture podcast where you learn to fight the enemies that blocks your way to become a successful professional in tech.Listen the podcast
Regular expressions combine both basic and special characters to detect patterns in strings, some of those patterns include whitespaces.
There are several ways on regular expressions to detect whitespaces, the most used one would be the \s or \s+ since they detect not just whitespaces made by the space bar, but with tab and return key (line jump).
Dealing with spaces is a common action when receiving data from our apps, that's why we need to learn how to detect them. Using RegEx allows us to easily detect the presence of white spaces and deal with them as needed.
We can use different RegEx to achieve this:
\s Will take a single whitespace character, but when dealing with line jumps and text separated by the "return" button, won't return anything, since en the exposed cases, are more than one whitespace.
\s+ When added the +, you are stating that can be one, or any amount of whitespaces (spaces, tabs, and line breaks).
[\r\n\t\f\v ] This RegEx is equivalent to
\s but we add it for ompatibility reasons with older programming languages.
\t matches tabular whitespaces
(" "). The
\s+ will match this as well.
\w matches alphanumeric characters and the underscore (whitespaces included)
Usually, you'll find the
\s+ are the most used ones, since they comprehend the other ones we discussed.
In the following example, we'll be checking if a url has whitespaces or not.
A regular expression (also called regex or regexp) is a way to describe a pattern. It is used to locate or validate specific strings or patterns of text in a sentence, document, or any other character input. You can learn more about Regular Expressions in this RegEx Tutorial.
You can find more articles related to this topic in 4Geeks. Hope you enjoyed the reading and keep on the Geek side!