Regular Expressions in JavaScript - #1 REGEX ULTRA BASICS @OfficialDevTips
Regular Expressions in JavaScript - #1 REGEX ULTRA BASICS  @OfficialDevTips
Uploaded May 2018 | Updated November 2026, 10 minutes ago
A regular expression (or regex) is way to find strings within strings. It's small code that when applied to a string, will give other strings - either the whole string or parts of the string. This video gives you the ULTRA BASICS of REGEX.

Regexes most common use cases are:
What can we use them for?

1. Validation
If something is formatted correctly. Like verifying if someone has inputted the correct things in a form like an email address or a postal code

2.Extraction
Extract parts of a string that we would like to use. Say find how many times someone wrote "david" in a text.

Replacement
Find all parts of the string with "david" and replace them with something else like "devtips".

You will learn:
- creating regex in two ways in JavaScript: slash notation or with the constructor new RegExp()
- escaping the special characters
- the special characters and how they work: ^, $, *, +, [a-z], [0-9], \w, \d for example



Companion code used in the episode
codepen.io/devtips/pen/gzqKKP

Or try one of these tools to experiment with regexes. They all do basically the same, it's just a matter of taste:
regexpal.com
regexpal.com
regex101.com

Read more on MDN, it's the best resource:
developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions
Regular Expressions in JavaScript - #1 REGEX ULTRA BASICSYour First Rails Application  [ Ruby on Rails from the ground up - 4/5 ]Learn jQuery in 15 minutes – Part 3 – Event Binding, Dom TraversalWhy React JS for prototyping? - #2 React JS prototypingWhat Happened to DevTips THIS TIME??Dynamic text filtering on the client - #11 React JS prototypingSunday Live StreamCreate a Subscription Form from Scratch using HTML, CSS and MailChimpMatthew Tran - Engineered Truth – InterviewDesign & Code a Mobile First Landing Page! (2/4)Trying Kubernetes 📦 for the First TimeMOAR populating components with data - #10 React JS prototyping
DevTips |

Regular Expressions in JavaScript - #1 REGEX ULTRA BASICS

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER