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

android - net_scheduler holding wakelock -

sql - MySQL : Getting Entries from a many-to-many table -

java - Retrieving data from database using jsp (Hibernate + Spring + Maven) -