Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

allowing for single or double quotes

Status
Not open for further replies.

webdev007

Programmer
Sep 9, 2005
168
Well, I tried adding simple and double quote to my
preg_match but without success.
I tought it was not required to escape them in the regex.
Tried that, tried escaping.. no result

How may I allow for htose quotes?

if (!preg_match("/^[a-zA-Z0-9 \,\;\.\-\$\:\!\/?\/\< \>]+$/m",$this->any_text=$any_text) )

Thank you
 
if your pattern is enclosed in double quotes:
variables will be expanded,
double quotes inside the pattern will require escaping; and
single quotes do not require escaping.

if your pattern is enclosed in single quotes:
variables will not be expanded,
single quotes inside the pattern will require escaping; and
double quotes inside the patter will not require escaping.
 
Very interesting comments.
learning is easier when explanations are understandable
thank you
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top