### Regex

Course
Time
1 hour 37 minutes
Difficulty
Beginner
CEU/CPE
2

### Video Transcription

00:00
Welcome back to the several introduction course heretics. Today we will continue where we left off,
00:06
blessing three that any Lockhart's the nuts and character ranges.
00:12
So in our prior listen, we went over not character specifically more than not white space. But in this course on this lesson, we'll go over to any both the any characters. A mewling, which is more like a wild card. But unlike other software, this is particularly
00:28
one character That's unknown, right?
00:31
Unless you add again the quanta fires
00:34
and we also go for any characters like this is more like or statement right this or this or this.
00:41
And also any character between N g rug, which is the character range now
00:47
poster with digits this concept a little bit easier to learn with numbers, right? So if you do digits right, you will attack anything. But what if I only want to detect them? If it's within one and three in this case,
01:00
you put it like this didn't one and three
01:04
and you know I got it seems pretty easy and let whatever is within 17
01:10
for in seven
01:11
for nine. Egan already kind of figure out how
01:15
how this is going right now. You gotta be careful.
01:19
Because, for example,
01:22
this is not attend. This is at 10
01:26
So you're gonna be really, really careful what you write in there.
01:30
No,
01:32
you are submission earlier
01:34
here. You can do any off. So if I, for example, right 123 right. This is not
01:40
detect 123. This means that took either one or two or three.
01:46
And the Sync concert that applies for numbers applies for letters. So even write a B. C.
01:51
You can see this separated by a little The little box rained a little wet speed in the box. Or I could do a Z J right? You can see the orders, not that important. I do like to put them in order, but it's not really required.
02:04
And again, like in numbers, I can basically do Let's go from eight
02:07
h, he could detect O's are gonna say all these goats room, uh, K disease, for example, in the text does
02:15
where I can do
02:16
hey
02:17
see, et cetera. I can do it like right again. Like I said manually, right? Whatever.
02:23
No.
02:25
Want x dot For
02:28
right now I'm wondering.
02:29
You understand this already. You understand this arranged. You understand if I read them without the range. So what exactly is the dot for
02:38
again dot It's a lot of cards. If I write, just stopped.
02:42
Sorry,
02:43
detects everything. Just that you can see. It's detective ad, which is simple, and it is also additional box again. You want to actually find a thought. You had to escape the character
02:57
like it's saying here, escape special character.
03:01
No,
03:02
If you see carefully, you will see you again. Those those little white lines between the Capture Group again.
03:09
That is because it's individual detections, so the same that apply to slash w and slash D In regards for many characters, we want to see also apply to any characters right from the skiff. If I do,
03:25
I want to see either one or more men. Here are one sergeant
03:30
one or more. You can see now when you want more, it becomes a solid block.
03:35
Or I could do
03:38
same thing. Now
03:40
The reason This even though it's the first in the list, I didn't go over. It's because you can see it's really hard to see the quantify resistance hero more. One more, and it's because
03:51
there's nothing before or after what card. So if I write email
03:58
right now, you can see with that with the
04:01
so you're or more you can detect the evil itself, right?
04:05
Let me, actually.
04:06
Right this somewhat out. A number
04:12
in regardless. If s zero digits, one digit or multiple digits.
04:16
Now, if I do it with a plus,
04:21
you can see that it detects that
04:25
again.
04:27
One or more.
04:29
All right,
04:31
all right. If I do this here or we won't hear or one now you can see it. It it detects up to here.
04:38
Now you go like Oh,
04:40
but why is it detective at again? It's not a number. It's a character. So it's detecting either to your or one characters.
04:48
And the problem is that you don't give enough information. So guess what? Actually,
04:55
half too right
04:57
reminder
04:59
of this to be able to properly see.
05:01
But the Symbolist or the character, right?
05:04
So, like again to hear
05:08
one period, it takes only one digit, right?
05:12
If I'd go again
05:14
the plus not into Texas, there's
05:15
anything between right
05:18
that means changed his toe a letter. So you can see.
05:20
It doesn't matter what it is. It could be a symbol. It can be a percentage, for example, right? He will still find it.
05:30
And if I do, for example,
05:35
let's hear one
05:38
right
05:41
one or more.
05:42
All right,
05:45
any amount.
05:46
And you're like, OK, I understand that. And how would I use this? Well,
05:51
let's say you have an employer. Airtran investigate an employee and is called John,
05:59
right?
06:00
Yes, right at work dot com. Right.
06:03
However,
06:05
whenever you know that John Smith, for example, is very common name,
06:11
that's what they say, right?
06:14
You don't know if it's John Smith. John Smit one John Smith to judgment three or four
06:19
or if it even John Smith 12. So, in this case, since you don't know the precise email that it arrived from, you just know it's sort of half J. John s in it.
06:30
You will start using this so you can capture the e mails off all the John Smits on the gigantic company you officially just work for, and therefore do a proper investigation or do a proper search on what exactly was sent. And that's how you use that special character. Remember special characters. When you use them,
06:50
you have to have something afterwards.
06:54
Otherwise it will detect
06:56
everything
06:57
and everything. You've worked. For example, right global at
07:01
yahoo dot com.
07:04
Sorry, it's not gullible. It's eat. No,
07:10
you see now it doesn't detect it. Why? Because it is not hot milk.
07:16
However, if I come back here and say hot no,
07:20
they need it automatically. The Texas.
07:23
If I do remove that aspect, right,
07:28
I'll leave it up to add
07:30
you see now, Detective. So it is really important, too.
07:33
Put those extra parameters. Otherwise, you might accidentally
07:39
detect additional information that might not be required.
07:45
See
07:46
to be detected
07:48
again. If you're using that special character, make sure you break it Our next lesson. We will learn how to determine the exact length of characters you want to repeat in. More than one occasion does include digits, words, spaces and symbols. See you soon

### Regex

In this course you'll learn the basics of regular expressions, also known as Regex. As a professional you will understand when it is beneficial to use Regex and when it's not, how to construct Regex, and how to read Regex built by other professionals.

Kevin Hernandez
Instructor