I've been trying to match the following the path below with a regex:
path = "/r/356363/"
that looks like:
regex = RegExp("^\/r\/\d+\/$")
However, whenever I run test, I do
regex.test(path)
which returns
false
Why doesn't the regex match the path?
To me the regex says, find a string that starts with a /r/, has atleast one digit after, and ends in a /.
I checked the regex in http://regex101.com/#javascript and it appears as a match which leads me more confused.
regex = RegExp("^\/r\/\d+\/$")