Our site uses cookies. Learn more about their purpose and change of settings in a browser If you are using the site, you give you consent to use cookies, according to current browser settings. Got it

JavaScript Regex

  • Language JavaScript
JS Assessment for JavaScript regex knowledge. The exercise consist of a few simple tasks. You are supposed to implement functions, having provided only the function name and purpose.

JavaScript Regex

Summary

This is JS Assessment for JavaScript regex knowledge. The exercise consists of a few simple tasks. You are supposed to implement functions, having
only the function name and purpose provided.

Goals

Your solutions should be placed inside app/regex`.js file(inside window.regexAnswers object).

containsNumber(str)

It checks if the string contains number. It returns true if the string contains a number, or false otherwise.

containsRepeatingLetter(str)

It detects a repeating letter in a string.

endsWithVowel(str)

It determines whether a string ends with a vowel or not.

captureThreeNumbers(str)

It captures the first series of three numbers.

matchesPattern(str)

It determines whether a string matches a pattern or not.

isUSD(str)

It detects correctly-formatted monetary sums in USD.

Before you start...

JavaScript basic functions:

http://www.w3schools.com/jsref/

Javascript EcmaScript5 tutorials and more:

https://developer.mozilla.org/en-US/docs/Web/JavaScript

Setup

To install dependencies

npm install

JShint

To run jshint:

grunt jshint:default

Run tests

To start developing unit tests

grunt test:dev

To run tests and static analysis

npm test

Good luck!

Start this test

I agree to subscription in accordance with the terms of service.
Go to the top and begin