Conclusion
Here are our concluding remarks on the course!
Regular expressions are a very powerful tool, and, in this chapter, we’ve shown two different use cases for them: pattern validation and smart string replacement, essentially packing a lot of logic inside a single line.
While that might sound like an anti-pattern because you’re hiding logic, you’re actually saving a lot of time writing code and complex logic paths into a single line that, if you know how to interpret, gives you all the details you need.
Should you be using regular expressions everywhere? Not really. We wouldn’t recommend that, but if you’re dealing with complex operations with strings and your logic starts growing with the more use cases you consider, thinking about using RegExps might be a good alternative.
Get hands-on with 1200+ tech skills courses.