Regex valid IP address [duplicate]


Can anyone pls confirm is this a valid IP address validator, does it verify all the IP addresses. If not pls suggest a regex (am using JS), which validates all IP addresses

/^((([a-fA-F0-9][a-fA-F0-9]+[-]){5}|([a-fA-F0-9][a-fA-F0-9]+[:]){5})([a-fA-F0-9][a-fA-F0-9])$)|^([+-]?(?=.d|d)(?:d+)?(?:.?d*))(?:[eE]([+-]?d+))?([a-zA-Z](([+-]?(?=.d|d)(?:d+)?(?:.?d*))(?:[eE]([+-]?d+))?[a-zA-Z])+)$|(^([a-fA-F0-9][a-fA-F0-9][a-fA-F0-9][a-fA-F0-9]+[.]){2}([a-fA-F0-9][a-fA-F0-9][a-fA-F0-9][a-fA-F0-9]))$|(^([0-9]){15}$)/

Am new to regex

Thanks in advance

Source: JavaSript – Stack Overflow

November 29, 2021
Category : News
Tags: javascript | regex

Leave a Reply

Your email address will not be published. Required fields are marked *

Sitemap | Terms | Privacy | Cookies | Advertising

Senior Software Developer

Creator of @LzoMedia I am a backend software developer based in London who likes beautiful code and has an adherence to standards & love's open-source.