php preg match special characters

Solutions on MaxInterview for php preg match special characters by the best coders in the world

showing results for - "php preg match special characters"
Guadalupe
04 Aug 2019
1  $string="sadw$"
2  if(preg_match("/[\[^\'£$%^&*()}{@:\'#~?><>,;@\|\\\-=\-_+\-¬\`\]]/", $string)){
3   //this string contain atleast one of these [^'£$%^&*()}{@:'#~?><>,;@|\-=-_+-¬`] characters
4  }
5
Valery
03 Aug 2020
1  $string="sadw$"
2  if(preg_match("/[\[^\'£$%^&*()}{@:\'#~?><>,;@\|\\\-=\-_+\-¬\`\]]/", $string)){
3   //this string contain atleast one of these [^'£$%^&*()}{@:'#~?><>,;@|\-=-_+-¬`] characters
4  }