regex - Not allowing \ through regular expression -


i have created below regular expression:

"format":"^[^/]*$" 

to not allow forward slash , works. doesn't have allow forward slash. how can modify regular expression.

i tried below 1 doesn't work:

"format":"^[^/\\]*$" 

the backslash special character in regular expressions. that's why need escape backslash, loses special meaning (don't copy code yet, below):

"format":"^[^/\\]*$" 

if programming language uses backslashes escaping, might need apply 4 backslashes: first, parsed compiler, , later, regex engine process them time.

"format":"^[^/\\\\]*$" 

Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -