All right, let's see how you did here.
Now, I could just Google this and figure it out on my own.
And I recommend that you do that as well.
But for now, just based on the fact that we only have two things, let's try and write this from scratch.
Again, not something that I recommend, but hey, this will be fun.
Let's give it a go.
So how would I search for this?
Let's say I want to make sure that it's a password again, a character as long or more.
But first, I want to make sure that the password contains any sort of letters, numbers and these symbols.
You know what?
Just for fun, I'm going to add an extra challenge.
I'm going to say it also has to end with a number.
Now I know this is completely useless because you wouldn't want to password like that.
That's way too restrictive.
But I think this would be fun.
Now in here, we want to check a parser.
Let's say it's super secret.
It has some of those symbols that I mentioned, and it has to end with a number.
So we have to match all of this and it's over a character's.
The first thing I'm going to do is use our square brackets and say that we want to check for A to Z.
Which we've seen before.
If I scroll here, we have A to Z.
We also want to make sure it's lowercase as well.
So A to Z as well.
All right.
We're matching some of the things.
You also want to make sure that, yeah, you can use numbers 0 to 9.
All right.
So we have some numbers in here.
Let's say if I added some numbers, that works as well.
And we also want to make sure that we can use some of the symbols.
So let's just add the symbols that we can use.
Let's go back to here.
We can use this these symbols.
So let's just copy them.
And pace them in.
All right.
Everything in here that matches is good and looks like.
Yeah, we're matching things right now.
That's good.
But if I enter another letter here, that's not going to work.
We want to make sure that it ends with eight.
We also want to make sure that it's going to be at least eight characters long because I could just
do this and everything still works.
So how can we do it?
Well, let's look at the reference here.
If I scroll down.
Let's see.
We have exactly three of a kind.
Three or more.
This might be useful.
A three comma and these curly bracket matches at least three consecutive eight characters.
All right.
So it shows you exactly what it does.
I think this is useful.
So we want to make sure our password checker is at least.
Eight characters long.
So we're matching instead of a we're matching this whole string and it has to be at least eight characters
long.
So let's make it a characters long and look at that.
This is matching.
Awesome.
Now the next part is we want to make sure that it ends with a number.
So how can we do that again?
Let's check out here if there's anything special.
Let's do number.
Or digits.
All right, look at that.
Any digit.
So let's say any digit.
So this slash DX is going to match any decimal digit equivalent to 0 to 9.
All right.
So if I do, let's say slash DH, all right?
Everything is still matching, but if I type anything else out here.
Yep.
Now it's failing.
So there's our password checker right here.
So I can just go to code generator.
Copy this.
Go to my.
Ripple.
And here, let's just create a new one, say password that will have the compiled pattern.
Ah.
And then paste this in.
So this is going to be our password and I'm going to check our password.
Let's say B or let's just say check equals pattern or instead of pattern, let's do password.
And then we'll do a.
Full search.
And in the full search, we'll give it the string.
So the string that we're going to check will be the password.
So let's just change this up.
We'll say pattern here too.
So this will be pattern two, just so we name it properly and then the password.
Is going to be string some passwords some.
Numbers, maybe some symbols here and then ends with a number.
So let's see if that works.
If I do.
Password here.
And I do check click run.
Oh, it's not full search.
It should be full match if I click Run.
There you go.
Everything is working.
As soon as I type in a letter in here.
I get none.
If this is less than eight characters.
I get none again.
Very, very cool.
Hopefully you are able to get that.
If not, like I said, I think out of this entire course, this is probably the least important section
I know.
I'm telling you this at the end, so you at least do it.
But I wanted you to know that regular expression is a thing that you might encounter and you might use
throughout your career.
But like I said, it's one of those things that if I had to rank the importance of, it's probably at
the very end.
So hopefully your head doesn't hurt too much.
I'll see you in the next video.
Bye bye.