6 kyu

IP Validation

14,488 of 43,973wink

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 Trained96926
Total Skips13518
Total Code Submissions363565
Total Times Completed43973
JavaScript Completions14488
CoffeeScript Completions115
Python Completions15812
C Completions2861
Shell Completions554
PHP Completions2915
C# Completions3338
Go Completions3233
Elixir Completions351
Ruby Completions379
Rust Completions676
Factor Completions8
Dart Completions96
TypeScript Completions24
Lua Completions7
Kotlin Completions8
Groovy Completions2
Total Stars1341
% of votes with a positive feedback rating85% of 4392
Total "Very Satisfied" Votes3255
Total "Somewhat Satisfied" Votes929
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
  • Madjosz 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
  • FranzMartyn Avatar
  • rafacouto Avatar
  • CClairvoyant Avatar
  • metatable Avatar
  • Cameron637 Avatar
Ad