6 kyu

Valid Phone Number

7,102 of 21,233xDranik

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 Trained39085
Total Skips6100
Total Code Submissions119741
Total Times Completed21233
JavaScript Completions7102
CoffeeScript Completions215
Ruby Completions1612
Haskell Completions302
Python Completions5560
Java Completions4463
Shell Completions544
C# Completions1015
C Completions743
PowerShell Completions248
Total Stars371
% of votes with a positive feedback rating88% of 2236
Total "Very Satisfied" Votes1762
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