7 kyu

Is valid identifier?

609 of 2,312SIKV

Description:

Given a string, determine if it's a valid identifier.

Here is the syntax for valid identifiers:

  • Each identifier must have at least one character.
  • The first character must be picked from: alpha, underscore, or dollar sign. The first character cannot be a digit.
  • The rest of the characters (besides the first) can be from: alpha, digit, underscore, or dollar sign. In other words, it can be any valid identifier character.

Examples of valid identifiers:

  • i
  • wo_rd
  • b2h

Examples of invalid identifiers:

  • 1i
  • wo rd
  • !b2h
Fundamentals
Regular Expressions
Strings

Stats:

CreatedNov 4, 2015
PublishedNov 4, 2015
Warriors Trained4063
Total Skips300
Total Code Submissions11554
Total Times Completed2312
Java Completions609
JavaScript Completions671
Python Completions698
Ruby Completions159
CoffeeScript Completions22
C# Completions296
Total Stars54
% of votes with a positive feedback rating92% of 399
Total "Very Satisfied" Votes340
Total "Somewhat Satisfied" Votes53
Total "Not Satisfied" Votes6
Ad
Contributors
  • SIKV Avatar
  • CrazyMerlyn Avatar
  • NaMe613 Avatar
  • ParanoidUser Avatar
  • FArekkusu Avatar
  • hobovsky Avatar
  • saudiGuy Avatar
Ad