6 kyu

IP Validation

14,333 of 43,364wink

Description:

Write an algorithm that will identify valid IPv4 addresses in dot-decimal format. IPs should be considered valid if they consist of four octets, with values between 0 and 255, inclusive.

Valid inputs examples:

Examples of valid inputs:
1.2.3.4
123.45.67.89

Invalid input examples:

1.2.3
1.2.3.4.5
123.456.78.90
123.045.067.089

Notes:

  • Leading zeros (e.g. 01.02.03.04) are considered invalid
  • Inputs are guaranteed to be a single string
Regular Expressions
Algorithms

Stats:

CreatedApr 4, 2013
PublishedApr 4, 2013
Warriors Trained95778
Total Skips13488
Total Code Submissions360935
Total Times Completed43364
JavaScript Completions14333
CoffeeScript Completions114
Python Completions15519
C Completions2837
Shell Completions547
PHP Completions2895
C# Completions3287
Go Completions3201
Elixir Completions348
Ruby Completions369
Rust Completions653
Factor Completions8
Dart Completions85
Total Stars1334
% of votes with a positive feedback rating85% of 4361
Total "Very Satisfied" Votes3232
Total "Somewhat Satisfied" Votes921
Total "Not Satisfied" Votes208
Ad
Contributors
  • wink Avatar
  • jhoffner Avatar
  • ZucchiniZe Avatar
  • MMMAAANNN Avatar
  • kszuster Avatar
  • anter69 Avatar
  • Chrono79 Avatar
  • Mazur213 Avatar
  • Blind4Basics Avatar
  • pmatseykanets Avatar
  • igal Avatar
  • zimo Avatar
  • Voile Avatar
  • My- Avatar
  • imatmati Avatar
  • FArekkusu Avatar
  • monadius Avatar
  • hobovsky Avatar
  • trashy_incel Avatar
  • zLuki Avatar
  • akar-0 Avatar
  • StepBack13 Avatar
  • Kacarott Avatar
  • razetime Avatar
  • AVElfallah Avatar
  • rafacouto Avatar
Ad