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 • 39,214 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 November 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 Intellection two segment with Rexall Rigley expression. So if you want to use regular expressions with your segment, you should know what is a regex and how to create your regex. Right. So first I will go with the what is I get? Let me start that basically is the shortcut for regular expression. And if any expression uses a pattern, then that expression is called regex or regular expression, then what is Bartra? Right. See if any expression uses a pattern, then that expression we are calling other IT or regular expression, then what is the pattern? I say simply pattern is a string which represents more than one word. So to explain this, I'm going to open my Denel. So let me open this. So as of Norgay's we know said command with your normal. Operations like, you know, somebody, if I want to, such a line which consists of let me take to my file. So I want to bring to the lines which consist of, let's say. Put. I want to bring to the lines which are having put in the lines. So I'm getting only one line right now, what I'm going to do is I'm going to write something, I'm going to write something because of that. What I'm going to get out of that. Now you're 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 lane. But now, because of this string, you're are getting multiple lines. The reason is this string is going to represent two words. They are like. Let me read it. One is beauty and one more is beauty. So this for starting later and ending it all, starting character and ending characters are fixed, but the character maybe you are, maybe that's why it is going to create two. Certain words, Watenpaugh, that's why you are getting the lines which are having either put or pork. Right now, if you are there here, you are writing one single thing, 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 a regex with your self-command. So there is once again, underlying that regular expression is nothing, but if any expression uses a pattern, then that expression is called regex. Then what about pattern, a pattern is the string, which represents multiple words, no Feodor 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 said, come on. So now we have 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 the expressions, right, actually, we have two different operations with your said command, you know, they are like viewing Philabundance, searching, find and replace insertion or deletion. Now, with a single word, we did all these things already. Now, Victor, I guess if you want to do all these operations with your self-command by using regular expressions, right, you have to 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, and what is a pattern, and you are using that expression with said, come on. Right. OK, thank you for watching this video.