Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
5 Fixed test case `0.0.0.0` because I misinterpret a sentence in the challenge description.
source | link

05AB1E, 26 24 23 22 23 bytes

'.¡©ïJ®JQ®нĀ®g4Q₅Ý®å`P¡©g4Q₅Ý®å`®1šDïþJsJQP

-1 byte thanks to @Emigna.
+1 byte for bugfixing test case 1.1.1.1E1 incorrectly returning a truthy result.

Try it onlineTry it online or verify all test casesverify all test cases.

Explanation:

'.¡              '# Split the (implicit) input by "."
   ©              # Save it in the register (without popping)
    ïþJ®JQg4Q    # Check for each that they do NOT# startCheck withthat athere "0"are (excludingexactly 0s4 itself),numbers
    ₅Ý®å          # and thatCheck theyfor consisteach of digitsthe only
numbers that they are ®нĀin the range [0,255],
    # Check that the first` number is not 0
    ®g4Q  # and push the #result Checkfor thateach therenumber areseparated exactlyonto 4the numbersstack
    ₅Ý®å  ®1šDïþJsJQ    # Check forthat each ofnumber thedoes numbersNOT thatstart theywith area in"0" the(excluding range0s [0,255]itself),
        `          # and pushthat thethey resultconsist forof eachdigits numberonly
 separated onto the stack
         P P   # Check if all values on the stack are truthy (and output implicitly)

05AB1E, 26 24 23 22 23 bytes

'.¡©ïJ®JQ®нĀ®g4Q₅Ý®å`P

-1 byte thanks to @Emigna.
+1 byte for bugfixing test case 1.1.1.1E1 incorrectly returning a truthy result.

Try it online or verify all test cases.

Explanation:

'.¡          '# Split the (implicit) input by "."
   ©          # Save it in the register (without popping)
    ïþJ®JQ    # Check for each that they do NOT start with a "0" (excluding 0s itself),
              # and that they consist of digits only
    ®нĀ       # Check that the first number is not 0
    ®g4Q      # Check that there are exactly 4 numbers
    ₅Ý®å      # Check for each of the numbers that they are in the range [0,255],
        `     # and push the result for each number separated onto the stack
         P    # Check if all values on the stack are truthy (and output implicitly)

05AB1E, 26 24 23 22 23 bytes

'.¡©g4Q₅Ý®å`®1šDïþJsJQP

-1 byte thanks to @Emigna.
+1 byte for bugfixing test case 1.1.1.1E1 incorrectly returning a truthy result.

Try it online or verify all test cases.

Explanation:

'.¡              '# Split the (implicit) input by "."
   ©              # Save it in the register (without popping)
    g4Q           # Check that there are exactly 4 numbers
    ₅Ý®å          # Check for each of the numbers that they are in the range [0,255],
        `         # and push the result for each number separated onto the stack
    ®1šDïþJsJQ    # Check that each number does NOT start with a "0" (excluding 0s itself),
                  # and that they consist of digits only
              P   # Check if all values on the stack are truthy (and output implicitly)
4 added 239 characters in body
source | link

05AB1E, 26 24 23 2222 23 bytes

'.¡©ïJ®JQ®нĀ®g4Q₅Ý®å`P

-1 byte thanks to @Emigna.
+1 byte for bugfixing test case 1.1.1.1E1 incorrectly returning a truthy result.

Try it onlineTry it online or verify all test casesverify all test cases.

Explanation:

'.¡          '# Split the (implicit) input by "."
   ©          # Save it in the register (without popping)
    ïJ®JQ ïþJ®JQ    # Check for each that they do NOT start with a "0" (excluding 0s itself),
              # and that they consist of digits only
    ®нĀ       # Check that the first number is not 0
    ®g4Q      # Check that there are exactly 4 numbers
    ₅Ý®å      # Check for each of the numbers that they are in the range [0,255],
        `     # and push the result for each number separated onto the stack
         P    # Check if all values on the stack are truthy (and output implicitly)

05AB1E, 26 24 23 22 bytes

'.¡©ïJ®JQ®нĀ®g4Q₅Ý®å`P

-1 byte thanks to @Emigna.

Try it online or verify all test cases.

Explanation:

'.¡          '# Split the (implicit) input by "."
   ©          # Save it in the register (without popping)
    ïJ®JQ     # Check for each that they do NOT start with a "0" (excluding 0s itself)
    ®нĀ       # Check that the first number is not 0
    ®g4Q      # Check that there are exactly 4 numbers
    ₅Ý®å      # Check for each of the numbers that they are in the range [0,255],
        `     # and push the result for each number separated onto the stack
         P    # Check if all values on the stack are truthy (and output implicitly)

05AB1E, 26 24 23 22 23 bytes

'.¡©ïJ®JQ®нĀ®g4Q₅Ý®å`P

-1 byte thanks to @Emigna.
+1 byte for bugfixing test case 1.1.1.1E1 incorrectly returning a truthy result.

Try it online or verify all test cases.

Explanation:

'.¡          '# Split the (implicit) input by "."
   ©          # Save it in the register (without popping)
    ïþJ®JQ    # Check for each that they do NOT start with a "0" (excluding 0s itself),
              # and that they consist of digits only
    ®нĀ       # Check that the first number is not 0
    ®g4Q      # Check that there are exactly 4 numbers
    ₅Ý®å      # Check for each of the numbers that they are in the range [0,255],
        `     # and push the result for each number separated onto the stack
         P    # Check if all values on the stack are truthy (and output implicitly)
3 added 87 characters in body
source | link

05AB1E, 26 2424 23 22 bytes

'.¡©ïJ®JQ®н<d®g4Q₅Ý®å)˜P¡©ïJ®JQ®нĀ®g4Q₅Ý®å`P

Try it online-1 byte thanks to @Emigna.

Try it online or verify all test casesverify all test cases.

Explanation:

'.¡          '# Split the (implicit) input by "."
   ©          # Save it in the register (without popping)
    ïJ®JQ     # Check for each that they do NOT start with a "0" (excluding 0s itself),
    ®н<d®нĀ       # Check that the first number is not 0
    ®g4Q      # Check that there are exactly 4 numbers
    ₅Ý®å      # Check for each of the numbers that they are in the range [0,255],
        `     # Mergeand allpush resultsthe togetherresult for each number separated onto the stack
      P   P    # Check if all values on the stack are truthy (and output implicitly)

05AB1E, 26 24 bytes

'.¡©ïJ®JQ®н<d®g4Q₅Ý®å)˜P

Try it online or verify all test cases.

Explanation:

'.¡         '# Split the input by "."
   ©         # Save it in the register (without popping)
    ïJ®JQ    # Check for each that they do NOT start with a "0" (excluding 0s itself),
    ®н<d     # Check that the first number is not 0
    ®g4Q     # Check that there are exactly 4 numbers
    ₅Ý®å     # Check for each numbers that they are in the range [0,255]
           # Merge all results together
      P      # Check if all are truthy (and output implicitly)

05AB1E, 26 24 23 22 bytes

'.¡©ïJ®JQ®нĀ®g4Q₅Ý®å`P

-1 byte thanks to @Emigna.

Try it online or verify all test cases.

Explanation:

'.¡          '# Split the (implicit) input by "."
   ©          # Save it in the register (without popping)
    ïJ®JQ     # Check for each that they do NOT start with a "0" (excluding 0s itself)
    ®нĀ       # Check that the first number is not 0
    ®g4Q      # Check that there are exactly 4 numbers
    ₅Ý®å      # Check for each of the numbers that they are in the range [0,255],
        `     # and push the result for each number separated onto the stack
         P    # Check if all values on the stack are truthy (and output implicitly)
    Post Undeleted by Kevin Cruijssen
2 added 315 characters in body
source | link
    Post Deleted by Kevin Cruijssen
1
source | link