Regex: Introduction to sed command with regex

Narendra P
A free video tutorial from Narendra P
Automation Engineer with Scripting Languages and Tools
4.5 instructor rating • 5 courses • 23,616 students

Learn more from the full course

Complete Bash Shell Scripting

Automate repetitive tasks with Bash Shell Scripting to save valuable time

18:20:28 of on-demand video • Updated September 2020

  • Students will be able to understand shell scripting concepts
  • Students will be able to understand unix filters like awk, cut and sed
  • This course is helpful to Automate repetitive tasks in different Admin areas like Linux Admins, Middleware Admins, Database Admins, DevOps Admin and AWS Cloud Admins
  • This course is helpful to write basic to advance level shell scripts
English [Auto] In this video we are going to see interaction two side command with XOR expression. So if you want to use regular expressions with your side command you should know what is it like X and how to create your X right. So first I will go with the what is it that gets. Let me start that basically regex is the shortcut for regular expression and if any expression uses your pattern then that expression is called like X or regular expression then what is Bada right. See if any expression uses a pattern then that expression we are calling as it gets or regular expression then what is that pattern right. So you simply pattern is a string which represents more than one word. So to explain this I am going to open my terminal. So let me open this. So as of now guys we know said combined with your normal operations like you know somebody if I want do such a line which consists of let me take first my file. So I want to print to the lines which consist of let's say I want to print the lines which are having put in the lines so I am getting only one line. I know what I'm going to do is I am going to write something. I am going to write something because of that. What I'm going to get after that no you are getting because of one simple searching word you are getting multiple lines. So actually this is a string based on this string you are getting some lines previously because of this string you got only one line but now because of this string you are getting multiple lines. The reason is this string is going to represent two words. They are like let me take it one is B you t and one Morris B T so this for starting line letter and an English that all starting character on an ink categories are fixed. But the middle character maybe you are maybe will. That's why it is going to create bu searching words potent part. That's why you are getting the lines which are having either put or right. Now if you are here you are writing one single string but it is going to represent two words. Now this is a pattern and you are using this pattern in this. That's why it is a regular expression pattern or simply regex with your set command so there is once again I am billing that regular expression is nothing but if any expression uses a pattern then that expression is called X then what about pattern apparently the string which represents multiple words my father in this entire expression so the expression you are using some pattern this pattern is going to represent two words right. That's why this expression is called regular expression with your set. Come on. So now we hope to learn different ways to write a pattern different ways to write a pattern such that it is going to represent multiple words right now without let expressions write actually we hold different operations with your said common. You know they are like viewing files contain searching Find and Replace insertion or deletion now with the single word we did all these things already know Victor X if you want to do all these operations with your set command by using regular expressions right. You how do you know how to create a pattern. That means this one how to create this one you have to know some rules to create this so we will learn all these rules well going forward with step by step right. So for timing you have to know what is it I guess on what is a pattern on the order using the little experience with said Come on. Right. Okay. Thank you for watching this video.