What is the meaning of this regexp?
javascript, regex
Solution
- `^` the start of the string
- `[A-Z]{3}` a character from A to Z repeated 3 times
- `-` the character `-`
- `[4-7]` a digit from 4 to 7
- `\d{2,4}` any digit from 0 to 9 repeated between 2 and 4 times
- `\$` the character `$`
- `$` the end of the string
Problem
i need to figure out what this regular expression means? ``` "^[A-Z]{3}-[4-7]\d{2,4}\$$" ``` I think it starts with exactly 3 letters and ends with 2,3 or 4 digits (also not sure about the dubble $-sings) . But I can't understand what this means: ``` -[4-7] ``` And I'm also not sure why there are 2 $ at the end ... thanks