Regular Expressions (Regex): All the Basics

preview_player
Показать описание
I go over how to get a lot out of just the fundamentals of regular expressions (regexes). We cover all the basics, but there is an even bigger world out there of possibilities I might cover in coming videos.

OR affiliate links to things l use:
Рекомендации по теме
Комментарии
Автор

"Crucifixion, well that's a nice thing as well." - Luke Smith, 2020

greyman
Автор

I feel like Luke's head is always cut off in his webcam view because his humongous chad brain wouldn't fit even if he went full screen.

robertoszek
Автор

2:06 grep stands for "global regular expression print". It is an ed command: g/re/p. Ed is the standard text editor.

Автор

16:30 You can also use [A-z] to match any upper or lower case character, because uppercase comes before lowercase in the ASCII table. That syntax actually means "match any character in the ASCII table between these two characters".

mastercontrol
Автор

"I want a period" - Luke Smith, 2020

simozonelayer
Автор

I use grep to cheat a text based game called 'hangman'.

I use GNU grep "-w' option to word matching..


Example:

$ grep -w 'v.ir.s' /path/to/dictionary/file


Thank you.

bahathir_
Автор

"\+" is nothing to do with the shell - it's because grep uses Basic Regular Expressions which doesn't include "+" as a metacharacter. If you use egrep (which uses Extended Regular Expressions) you won't need the "\".

migtrewornan
Автор

The problem for me with regular expressions is the learning curve with using them efficiently, and since I only need to use them infrequently, I never get familiar enough with their use, to use them to their best advantage. If I were using them all the time, I would not have to keep starting from scratch, learning how to use them.

jonathanwarner
Автор

Your channel has taught me more useful knowledge than college did

StickeeAce
Автор

15 years working as a developer, at last someone made regular expression easy! I finally understood! Thanks Luke!

davidbanhos
Автор

7:32 listen carefully when he says "spool", he makes the perfect old Minecraft fall damage sound! Wizardry

NikoxD
Автор

I swear I haven't really understood regex until now. Thanks for sharing your knowledge

cj
Автор

Words can’t describe how much I’m grateful for what you did

mansourq
Автор

Luke could do a 10 video series on Regex and still not scratch the surface. I encourage this content !!!

hammerheadcorvette
Автор

I really like the way you explain Linux stuff!!

kirk
Автор

To be honest this is one of the best videos on your channel Luke. Short and informative, thank you.

TheZMDX
Автор

Regular expressions is one of those things I need once in a while, wind up spending a bunch of time creating something that looks like I hit my head on the keyboard, then forget how I did it months later.

It can be simple, but it can also start to get long and tiresome if the requirement is more complicated, like matching any valid IP address


magetaaaaaa
Автор

Good introduction with good examples! To throw something useful into it, don't you find weird you need to escape '+' but not '*'? And '*' is a (famous) shell expansion, but '+' is not! Also, if this was the case, it would be solved by the usage of double quotes you do, which avoids expanding anything but the dollar sign (for variables), or by switching to single quotes, which don't allow for any shell processing. The actual thing happening is that grep uses default regular expressions and the plus sign is from extended regular expressions, which grep understands but only if they are escaped. To use extended regexps without the need for escaping their metacharacters, try egrep or grep -E.

FyahBurn
Автор

thank you so much, this is so useful and in depth. teach you basically 90% there
I literally sit through the whole thing effortlessly. great video

wepranaga
Автор

luke kept his knee in the face cam the entire time what a power move

eporeon