Regular Expression Part 1 : Introduction

Hello readers!
In this blog , I am going to write about JavaSript Regular Expressions, also commonly known as REGEX. This is the first part of this series.

Let’s get introduced with Regular Expressions ?

REGEX is an object that describes a certain p…


This content originally appeared on DEV Community and was authored by Swarnali Roy

Hello readers!
In this blog , I am going to write about JavaSript Regular Expressions, also commonly known as REGEX. This is the first part of this series.

Let's get introduced with Regular Expressions ?

REGEX is an object that describes a certain pattern of characters which is used to perform pattern-matching , find, search and replace functions on text or strings. It is also very important when we want to validate emails, usernames or passwords.

Basic Syntax

The basic syntax of a regex is : /pattern/

A very simple example of searching a regex in a string is, you simply have to write your desired pattern inside the / /.

let testStr = "Search the word regex in this string";
let testRegEx = /regex/;

In this introduction part, I want to leave it just to the basic syntax. In the next part, we will learn how to search a regex within a string.


This content originally appeared on DEV Community and was authored by Swarnali Roy


Print Share Comment Cite Upload Translate Updates
APA

Swarnali Roy | Sciencx (2021-07-24T22:09:56+00:00) Regular Expression Part 1 : Introduction. Retrieved from https://www.scien.cx/2021/07/24/regular-expression-part-1-introduction/

MLA
" » Regular Expression Part 1 : Introduction." Swarnali Roy | Sciencx - Saturday July 24, 2021, https://www.scien.cx/2021/07/24/regular-expression-part-1-introduction/
HARVARD
Swarnali Roy | Sciencx Saturday July 24, 2021 » Regular Expression Part 1 : Introduction., viewed ,<https://www.scien.cx/2021/07/24/regular-expression-part-1-introduction/>
VANCOUVER
Swarnali Roy | Sciencx - » Regular Expression Part 1 : Introduction. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/07/24/regular-expression-part-1-introduction/
CHICAGO
" » Regular Expression Part 1 : Introduction." Swarnali Roy | Sciencx - Accessed . https://www.scien.cx/2021/07/24/regular-expression-part-1-introduction/
IEEE
" » Regular Expression Part 1 : Introduction." Swarnali Roy | Sciencx [Online]. Available: https://www.scien.cx/2021/07/24/regular-expression-part-1-introduction/. [Accessed: ]
rf:citation
» Regular Expression Part 1 : Introduction | Swarnali Roy | Sciencx | https://www.scien.cx/2021/07/24/regular-expression-part-1-introduction/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.