Beta

RegEx Like a Boss #5 CodeGolf: Decimal Number Divisible By 3

Description:

Create a Regular Expression that matches a string representing a number divisible by 3.

Matching with re.match()

Should match:

-3
0
3
6
9
18
24
30
48
51
69
72
81
96

Should NOT match

-03
-5
-0
1
2
4
5
7
8
10
11
13
14
16
20

Restrictions

  • numbers can be as positive as negative
  • leading zeros are not allowed
  • CodeGolf : string length is restricted to 150 characters
  • random numbers will range from -10^10 to 10^10

This tools may help you:

Cheat sheet

Online tester

Mathematics
Regular Expressions
Strings
Fundamentals
Restricted
Algorithms

Stats:

CreatedJan 3, 2019
PublishedJan 3, 2019
Warriors Trained187
Total Skips54
Total Code Submissions251
Total Times Completed28
Python Completions28
Total Stars9
% of votes with a positive feedback rating87% of 15
Total "Very Satisfied" Votes12
Total "Somewhat Satisfied" Votes2
Total "Not Satisfied" Votes1
Total Rank Assessments15
Average Assessed Rank
4 kyu
Highest Assessed Rank
2 kyu
Lowest Assessed Rank
6 kyu
Ad
Contributors
  • sgerodes Avatar
Ad