Latest
Loading...

Python for Ethical Hacking

Command Prompt

Featured Post

#5 Jarvis

Jarvis      Now we are going to create some functions. With the help of this functions we are going to make our Play music Open website...

#15 Using RegEx in MAC Changer || Python for Hacking

#15 Using RegEx in MAC Changer || Python for Hacking

 Python for Hacking

MAC Changer

Using RegEx in Python


To use Regex we use to import re module. And we use search function in re module. I have explain the theory in previous post so I will just explain the commands we use.

Commands

  • import re
In this command we import the re module
  • mac_address_search_result = re.search(r"\w\w:\w\w:\w\w:\w\w:\w\w:\w\w", ifconfig_result)
In this command we search the MAC Address using the rule and save it in a variable
  • print(mac_address_search_result.group(0))
In this command we print first capture string in mac_address_search_result using group






No comments:

Post a Comment