Okay, now we just, uh, done the first tip.
Okay, let's execute and read ifconfig.
We are able to read the ifconfig.
Okay.
And now it is time to read the Mac address from output.
Okay.
So where is the output.
Let me show you.
This is the output okay.
And this is the Mac address.
Okay.
So how can I capture only the Mac address and read this.
Okay.
There is something.
Okay.
There is one thing, uh, something or one thing that is called regex or regular expression.
You can use it in any programming language, but in Python we are going to use it and you are going
to learn it how to use it.
There is a website called Politics and politics.org.
When you can write in here okay.
And you're going to see something like this, you're, you're not going to see this one and you're going
to see something like this.
Okay.
So here if you add something, anything.
Okay.
Your test here.
Your test string here in this part and your regular expression here.
And the result will be shown here.
And also regular expression cheat sheet also here.
So here we have very good description.
For example if you want to use dot at the beginning or anywhere it is going to match any character okay.
Any character that means all characters.
And if you use alphanumeric, if you want to find alphanumeric, that is something we are going to use
here.
Okay.
That is included from 0 to 9 A to Z and also A to Z and also underscore.
So we are going to use a slash w okay.
This small one not Capital One.
So let's come back here and let's select our ipconfig result okay.
I am going to select everything from here.
I'm going to copy selection.
And then I'm going to go to browser here I'm going to paste that.
So I use control V so now it is pasted.
So here let's hit dot here.
And this is the matched result.
As you see right now it is selected.
Everything okay.
It is not what we want.
So what we want is the Mac address.
Where is the Mac address.
Let's find that.
So either this is the Mac address.
As you see this part is called Mac address okay.
So we have two number.
And then we have this called alphanumeric okay.
So we can use this part okay.
Slash w alphanumeric again alphanumeric alphanumeric alphanumeric alphanumeric and alpha numeric here
okay.
And also we have to use colon as well here okay.
So let's do that here.
For example I am going to select a slash w.
That is something that is looked there okay.
So as you see it is it's selected all the numeric and also all the alpha alpha numeric alphabet and
also numeric.
So it's selected all and everything.
I'm going to use it again.
Slash w.
So right now it is again selected alpha and numeric numbers and alphabet.
So here as you see it is not selected the colon.
So let's use colon here.
Wow.
This time it is better.
Okay.
Right now you see that we selected alphanumeric and we haven't selected the last one maybe.
And that is because the at the end it doesn't have colon okay.
Because of that it is happened.
It doesn't selected that yet.
So what is the solution.
Okay.
We have 123456.
What if I select I use backslash backslash WWW6 time.
So I'm sure it's going to solve the problem.
Okay.
Let's go and do that.
Okay w slash w and then colon.
Slash w w So now you see we have selected these three, four, five and six.
I'm going to select that six times.
Slash w w w w w w.
Now as you see it's selected only only the Mac address okay.
The ether as you see that here right now it is this one.
If it if it has for example alpha alphabet again it's going to select it.
No problem.
So now this is our regular expression.
We are going to use it with Python.
And if someone trying to learn other programming language like Java or even JavaScript, they can use
the same thing.
So right now we provided a regular expression to select only the Mac address from ifconfig result.
And let's go and see how we can use it to extract this from the output.
Okay.
So let's go and do that in the next lecture.