6 kyu

Valid Phone Number

7,111 of 21,272xDranik

Description:

Write a function that accepts a string, and returns true if it is in the form of a phone number.
Assume that any integer from 0-9 in any of the spots will produce a valid phone number.

Only worry about the following format:
(123) 456-7890 (don't forget the space after the close parentheses)

Examples:

"(123) 456-7890"  => true
"(1111)555 2345"  => false
"(098) 123 4567"  => false
Regular Expressions
Algorithms

Stats:

CreatedOct 17, 2013
PublishedOct 17, 2013
Warriors Trained39160
Total Skips6102
Total Code Submissions119877
Total Times Completed21272
JavaScript Completions7111
CoffeeScript Completions215
Ruby Completions1613
Haskell Completions302
Python Completions5572
Java Completions4473
Shell Completions544
C# Completions1021
C Completions747
PowerShell Completions248
Total Stars371
% of votes with a positive feedback rating88% of 2239
Total "Very Satisfied" Votes1765
Total "Somewhat Satisfied" Votes407
Total "Not Satisfied" Votes67
Total Rank Assessments25
Average Assessed Rank
5 kyu
Highest Assessed Rank
5 kyu
Lowest Assessed Rank
7 kyu
Ad
Contributors
  • xDranik Avatar
  • jhoffner Avatar
  • sru Avatar
  • bkaes Avatar
  • brunolm Avatar
  • gttotev Avatar
  • Blind4Basics Avatar
  • zimo Avatar
  • Voile Avatar
  • Souzooka Avatar
  • rowcased Avatar
  • Awesome A.D. Avatar
  • hobovsky Avatar
  • Console Cowboy Avatar
  • Just4FunCoder Avatar
Ad