There are a thousand regular expression questions on SO, so I apologize if this is already covered. At first I watched.
Given the following pattern:
(?:/|-)[0-9]{2}$
And the following lines:
str1 = '65/65/65' str2 = '65/65/6565'
Matches:
str1 = '/65' // expected '65' str2 = '' // as I expected
My intention with ?: Should match, but not include / or - . Which correct regular expression matches my expectations?
javascript regex
Adam cook
source share