regex ranges

Solutions on MaxInterview for regex ranges by the best coders in the world

showing results for - "regex ranges"
Van
08 Jan 2021
1/* character ranges */
2regex = /[a-z]/; // matches all lowercase letters
3regex = /[A-Z]/; // matches all uppercase letters
4regex = /[e-l]/; // matches lowercase letters e to l (inclusive)
5regex = /[F-P]/; // matches all uppercase letters F to P (inclusive)
6regex = /[0-9]/; // matches all digits
7regex = /[5-9]/; // matches any digit from 5 to 9 (inclusive)
8regex = / [a-d1-7]/; // matches a letter between a and d and figures from 1 to 7, but not d1
9regex = /[a-zA-Z]/; // matches all lowercase and uppercase letters
10regex = /[^a-zA-Z]/; // matches non-letters