 Okay, again, this is a series should be an annotation on the screen to the full playlist recommend watching them. This is video 12 I believe in this series on said We've been working with a text file here. I've also created another text file for more of the upcoming ones Videos just with line numbers to make it easier for you to see which lines are being removed We're gonna be playing around with both these files But let's have a look at Modifying Sorry full word match So if I was to use said as we have been and I want to substitute a word From our text to file Let's say I wanted to substitute Everywhere there was the word new With the word old well if I do that you'll notice that we do Substitute where the word new is with the word old But you'll also notice that we got older here And maybe we don't want to modify the word newer to the word older. We want to keep that newer just as an example Well one thing we could do is we can come in here and we can give this a space so we can say find where it says New with a space and we can hit enter and you can see here on line Three we replaced it of course we did remove the space after it So we'll actually want to replace new with a space with old and a space So that fixes that problem, but it didn't modify the new down here Well, the reason for that is because there's no space after that. There's a new line character after that It's the end of the line So to fix that one we could say you know find new at the end of the line because we know that The dollar sign means end of line and we can replace new there with old But that doesn't fix this one So we could put two commands together as I've shown you or we can say substitute new space with old space and New at the end of the line with old and that should work which it does But that's getting kind of complicated and if you have a big file You may not know if they're at the end of line. Maybe there is in a space. There's there's a lot of snails There's so what we're going to use here are regular expressions to find the bounds of a word So what I could do instead of all this I could just do find New and remember our back slashes indicating something special in this case B and the same over here new B so we'll hit enter And you'll see that both the old here was replaced the old here was replaced But the newer here and the newer here were not replaced because it's looking for a whole word match of new now we also have new here Which wasn't replaced and that's because It's capital we should be able to I think put an I here a capital I and That did replace it now It did replace it with a lower case old rather than a uppercase old But that's something for another tutorial But we did replace everywhere where it has the whole word new with the whole word old And not replacing partial matches So that's it. Let's quickly look at the command. We got said which is our command then inside our quotations We're saying let's s for substitute our back slash B's means bounds meaning that what's between them is a whole match not a partial match and We're gonna replace it with this and then we're gonna say look at it case insensitive don't worry whether it's capital or a lower case and Then G means globally do it for every instance on every line And then this is the file at working with and again, we haven't modified our original file We're just modifying output if we want to modify the original file We would do the dash I be careful with that that Will not warn you and override the old file and there's no undo for that And if you want to create a new file, we can just say new file that will put it in a new file I can cat out the new file with the changes, but I still have the old original file Well, that's it for the tutorial if you have questions before to be sure to visit my IRC channel Comments are a great thing but not a great place for technical questions. Be sure to like subscribe visit my website films by Chris comm That's Chris the K there should be a link in the description and I hope that you have a great day See you next week with more said next Monday