2.2 Character Classes: Words, Digits, and Spaces - RX
Join over 3 million cybersecurity professionals advancing their career
Sign up with
Required fields are marked with an *
Already have an account? Sign In »
1 hour 37 minutes
Welcome back to the several introduction course to read IX. I'm your host, Kevin Hernandez. Today will be going over a lesson to off our second model, which will cover words ended its inside regular expression search parameters.
Let's go back to Reddick, sir.
No, here. Half a couple of numerical strings. As long as the word strings.
Well, you're talking about word digits and white spaces,
right? Everything click here like we learned of previous lesson. You could match anywhere, character, often America, or underscores. So
if I also right,
Captain Hernandez, what underscore? You can see that it's also detected.
Now, if you're paying close attention,
you see, it's a lot of small squares. It means it's detecting one character at a time. If you're bailing out rejects again, be careful
because in here you will be detecting neither That want the 234 or five or six right instead of the whole sequence of numbers here.
So how do you fix that? Is with qualifiers
right down here
for one to take at lease
one or more characters a cave
the plus sign,
which is very common,
commonly found here with, uh,
rednecks. All right, with the doubly in the d basically means yes, if it there's a least one character. I want to find the sequence.
Now. If you look closely, you can see them now instead of being a lot of small squares. It's a
big, solid block of numbers, and here, very similar. Again. You will see the slash the dash is here that broken up. So obviously it's not
that good if you wanna put it that way, but in here you will have four sets instead of one
from there, for you will have to write to secrets a slightly different.
Now you can see the text numbers and words, but just because it works for both doesn't mean you should use slash W for both. If your child go just for digits, it is actually more efficient to write slash tea and you can see now it will be detecting on Lee the numbers again if you now see carefully one or more
detecting one here,
So what about if I want to detect if there's let's say
zero or one,
Okay, But how does that work? I mean, if I just do this,
nothing change. Well, it does, actually,
if I start writing Kevin,
You can see it. Detective Deaths. This one, right.
And this one? Why? Because it looking for if it's a numbers there are not there.
And therefore, this is a number.
Danny goes like it's there. Now, if I, for example, switched that
seer or one to a plus,
you can see that only now it detects the one that has at least one number in the sequence
If I go back here again, right,
and I do 11.
Such back to
So you're our one. You can see now They want asked to. Numbers is not detected. Right?
How about the store?
But the star actually would look
regardless if it's has or doesn't have the number, and therefore it will detect all the sequences.
So you see, it's it's very important you learn how to use this qualifiers, because otherwise you'll be doing the incorrect heretics.
let's go over words. Right,
So here you have Captain Hernandez
put it all together, You see? Okay.
Oh, it doesn't take the top one because there's a white space. Okay, I can put a white space manually.
we reckon. Also
put it like this. All right, that was The difference is,
if you don't know how many white spaces they're gonna be, you cannot be gassing, right.
So let's see, It has to
Let's say that has three, right, because he likes to lick, lick some little thoughts in there and symbolizes how many spaces are. So if I try to do this, they're gonna go. Oh, space.
Oh, there you go. It work again, Depending under Reddick stole. That might not work. So it's always safer to use the white spaces. A such
now here we go like, OK, so there's a once one space right
here. I will deal with the question mark. Right, So you are one. I will detect the one that has no spaces or one space
painting with a plus. Here All the technique has one space or more, and therefore this one's not selected.
that's no digit numbers.
here I will detect if it has
any number of spaces or no spaces.
Again works both put words and with numbers.
Now you're probably thinking
but how about not word or not? a number. Oh, pretty easy.
Listen, not space, right?
Oh, guess what? Now those at spaces are not detected.
Therefore, they want to have numbers or on their scores or a special character, even. Right? If I, for example, go here
and right up Sorry,
right. A special character. That's not
that's it. Bye slash W
All right. He will still be detected
This is what records is built in. You're not sure what is in there, and you can still find it,
And this is how not worked. And I guess slush, as is the best and East is example to show how this works.
No, we have basically scene
more or less, right,
what's what and regarding words. And it's you know, that words will the checking digits and underscores.
But even so, it's better if you're just looking for numbers to use the slash digits function. You already know how to use the qualifiers and inter nations of zero or more One or more RC or one.
And as we go over, you will start to grasp these segments. This might look really simple, but it takes a lot of it a practice to understand which quantified to use properly. You're finally getting the graphs of this, and as we move forward, it will be easier and easier to understand rejects. If you have any questions, don't hesitate to contact me.
I'm here to help.
Have a great day.