Regular Expressions 101

Community Patterns

validate Page range input

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