[thelist] Looking for a regular expression for Content-Type, as per RFC2045

Andy Warwick mailing.lists at creed.co.uk
Tue Aug 19 05:29:33 CDT 2003


Hi

I'm looking for a regular expression (for PHP) to validate Content-Type  
headers, as per RFC2045.

I'm writing a form handling class, and need to do some error checking.  
According to spec., the form's enctype attribute must comply with the  
afore-mentioned RFC.

<http://www.w3.org/TR/xhtml1/dtds.html#dtdentry_xhtml1- 
transitional.dtd_ContentType>

I could go with the basics of 	'multipart/form-data' and  
'application/x-www-form-urlencoded', but that wouldn't be accurate  
according to spec.

Any one have one handy, or can point me at a good source?

TIA

-- 
Andy Warwick
Creed New Media Design
w: http://www.creed.co.uk



More information about the thelist mailing list