Private IP Address Identifier in Regular Expression

0 votes

I'm curious if the following is the best approach to match a string that begins with a private IP address (Perl-style Regex):

(^127\.0\.0\.1)|(^192\.168)|(^10\.)|(^172\.1[6-9])|(^172\.2[0-9])|(^172\.3[0-1])

Feb 14, 2022 in Cyber Security & Ethical Hacking by Edureka
• 13,620 points
3,387 views

1 answer to this question.

0 votes

I'm assuming you want to match these ranges:

127.  0.0.0 – 127.255.255.255     127.0.0.0 /8
 10.  0.0.0 –  10.255.255.255      10.0.0.0 /8
172. 16.0.0 – 172. 31.255.255    172.16.0.0 /12
192.168.0.0 – 192.168.255.255   192.168.0.0 /16

i could get 192.168.1.1 match 

answered Feb 16, 2022 by Edureka
• 12,690 points

Related Questions In Cyber Security & Ethical Hacking

+1 vote
1 answer

How to find IP address of nodes in my network?

The IP address of the nodes connected ...READ MORE

answered Feb 9, 2019 in Cyber Security & Ethical Hacking by Omkar
• 69,220 points
4,943 views
0 votes
1 answer

how to find ip address in cmd

1. Open the Command Prompt.   a. Click the Start icon, ...READ MORE

answered Feb 9, 2022 in Cyber Security & Ethical Hacking by Edureka
• 13,620 points
47,542 views
0 votes
0 answers

find IP address by domain in go

I am using below code for an ...READ MORE

Feb 16, 2022 in Cyber Security & Ethical Hacking by Edureka
• 12,690 points
1,224 views
0 votes
1 answer

How do i check a ip address range whether it falls in Class A,Class B,Class C

class NetworkId{ static String findClass(String str){ int index = ...READ MORE

answered Feb 16, 2022 in Cyber Security & Ethical Hacking by Edureka
• 13,620 points
907 views
0 votes
1 answer

Removing all white-spaces from a string

You can use the 'str_replace_all()' function from ...READ MORE

answered May 16, 2018 in Data Analytics by Bharani
• 4,660 points
622 views
0 votes
1 answer

What Regex to use to identify a Block Hash?

Blockhashes are always 64 characters in length. You ...READ MORE

answered Aug 28, 2018 in Blockchain by digger
• 26,740 points
1,828 views
0 votes
1 answer

R programming logic

Use gsub to match the substring that we want ...READ MORE

answered Nov 16, 2018 in Data Analytics by Maverick
• 10,840 points
756 views
0 votes
1 answer

.replace() regex in Python

No,  .replace() does not support regex. Regular expressions ...READ MORE

answered Nov 26, 2018 in Python by SDeb
• 13,300 points
915 views
0 votes
1 answer

Public IP address vs Private IP address

Is it correct that mobile phones utilise ...READ MORE

answered Feb 24, 2022 in Cyber Security & Ethical Hacking by Edureka
• 12,690 points
2,152 views
0 votes
1 answer

Can I determine the current IP from a known MAC Address?

ARP may be used to retrieve an ...READ MORE

answered Feb 20, 2022 in Cyber Security & Ethical Hacking by Edureka
• 12,690 points
633 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP