You need to sign in or sign up before continuing.×
2 kyu

Regular Expression - Check if divisible by 0b111 (7)

748 of 2,222Hacker Sakana

Description:

Create a regular expression capable of evaluating binary strings (which consist of only 1's and 0's) and determining whether the given string represents a number divisible by 7.

Note:

  • Empty strings should be rejected.
  • Your solution should reject strings with any character other than 0 and 1.
  • No leading 0's will be tested unless the string exactly denotes 0.
Puzzles
Regular Expressions
Strings
Algorithms

More By Author:

Check out these other kata created by Hacker Sakana

Stats:

CreatedJan 26, 2016
PublishedJan 26, 2016
Warriors Trained14736
Total Skips2996
Total Code Submissions20901
Total Times Completed2222
JavaScript Completions748
Python Completions787
Java Completions288
Ruby Completions128
CoffeeScript Completions57
C# Completions227
C++ Completions258
PHP Completions127
BF Completions20
Go Completions73
TypeScript Completions72
Kotlin Completions51
Factor Completions18
Haskell Completions58
C Completions76
Rust Completions44
Total Stars576
% of votes with a positive feedback rating92% of 430
Total "Very Satisfied" Votes378
Total "Somewhat Satisfied" Votes35
Total "Not Satisfied" Votes17
Total Rank Assessments5
Average Assessed Rank
2 kyu
Highest Assessed Rank
2 kyu
Lowest Assessed Rank
4 kyu
Ad
Contributors
  • Hacker Sakana Avatar
  • Unihedron Avatar
  • candrabeqx Avatar
  • bshore Avatar
  • nomennescio Avatar
  • Voile Avatar
  • monadius Avatar
  • Awesome A.D. Avatar
  • hobovsky Avatar
  • el-f Avatar
  • pa-m Avatar
  • LearningFTW Avatar
  • avermakov Avatar
Ad