According to http://www.regexr.com/38o5d my reqex seems to work, but when I implement it into my javascript
var prefix = hash.replace(/\/|#/g, '');
I'll get the following error: SyntaxError: Invalid regular expression: missing /
Psychic debugging: Your code isn't in a plain JavaScript or HTML file, but is being printed from a scripting language in which #
is a comment character. The #/g, '');
piece is being treated as a comment in your script.
You need to add some quotes to ensure that the whole line gets printed.
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