Skip to content

RubenCastroCoding/Regex-Tutorial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 

Repository files navigation

What is Regex Expression

Javascript has many methods that tell us if a string contains a certain character or term. Take a look at this example below. 'Ruben Castro is the Shift Lead' ends with ('Shift Lead') This method is ok most of the time but it does have some flaws. What if you needed to find a string with have the word "Shif Leads" and not just one "Shift Leads". These issues can be solved with additional statements that go more in depth and require parameter that you want, or you can turn them into a regular expression and make it easy for you.

Summary

Regular Expressions, also known as Regex are patterns used to match character combinations in strings. Regex lets you search and manupilate text strings. Regex is good because it saves you alot of time when writing code.

Table of Contents

Grouping Constructs

A part of a pattern can be enclosed in parentheses (...) . This is called a “capturing group”. That has two effects: It allows to get a part of the match as a separate item in the result array.

Bracket Expressions

A bracket expression represents a character set via a list of characters enclosed by the square brackets: '[' and ']' If it matches data character from the list to match the target string.

Character Classes

Character classes can tell the difference letters and digits and much more. Here are 2 examples of character classes: \s: Matches whitespace character. \t: Matches a tab.

Character Escapes

You can do very specific and detailed searches . For example if you use the following \.. The \. allows us to find not just any character, but with just a dot you can access data inside that folder.

Creator

My name is Ruben Castro and if you want to check out my work do so here --> https://github.com/RubenCastroCoding

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published