![]() So how do we write a regular expression? A regular expression literal is written with two forward slashes. In this video you have going to look at the literal syntax only as it is the compact and most common in use. In JavaScript, Regular expressions are also objects so you can use them as literal as shown here or instantiate them using the new operator with the regex constructor. Regular expressions are patterns used to match character combinations and strings. ![]() ![]() Now our task as developer is to find this data using the patterns and collect specific information.ġ:36 How do we achieve this in JavaScript? Enter regular expressions. The marketing team needs the name and phone number while the billing team needs to have credit card information so that they can collect the payment from the users. Their name, their phone number and their credit card information and there are two teams, marketing and billing who need this specific information from this dataset. But as developer, if you need to implement such a search, how would you implement it? Let's say we have a given data set that contains three pieces of information about the user's data and in no particular order. The truth is that it happens behind the scenes for you and you don't even worry about all of that. In fact, the string may appear anywhere in the text and often more than once.Ġ:50 So does that mean that you will have to go and read the entire file to find the pattern you're looking for? No, you don't. Also, there is not a predefined specific location where you can find this pattern. We do these searches all the time, but as you see we are looking for the specific information inside the data which is not structured. For example, when searching for a specific string among all our emails or filtering a spreadsheet with a specific term we are interested in or when searching for a string pattern using our browsers. But when would that searching inside another string might be useful? Well, we all do that all the time even if you're not aware of using them. In this video you will learn about how to find a string pattern inside another string pattern using regular expressions. ![]() 0:00 Hey, it's Harit Himanshu from bonsaiilabs. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |