The regular expression for a string that ends with '/' is the following:
str.match(//$/) -- javascript syntax
but the // makes the compiler think it's a comment. how to work around this?
You must escape the final /
so the interpreter doesn't think it terminates the RegExp literal:
str.match(/\/$/);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With