PHP regex to include double backslashes in brackets -


so trying relatively simple php regex check wether string contains 1 of these characters: .,%$@/0123456789 want check wether contains double backslash (i don't want evaluate true if contains 1 backslash) , can't figure out how it. appreciated :)

here using far:

preg_match('/[.,%$@\/0-9]/',$string) 

i not sur how include '\\\\' double backslash.

thanks in advance!

you're looking character set or double backslash, right? so:

preg_match('/[.,%$@\/0-9]|\\\\/',$string) 

where | means "or".


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -