Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
ECMAScript (JavaScript)

/
^(\s*\d+\s*\-\d+\s*,?|\s*\d+\s*,?)+$
/
gm

Description

Given an iput of page range by the user, validate if the input matches an acceptable format.

Submitted by Anwesh Gangula - 3 years ago