By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,254 Members | 2,365 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,254 IT Pros & Developers. It's quick & easy.

checking for Euro currency symbol in regexp

P: n/a
Hi, I want to check that a string entered via a from contains the only
cdertain characters including the Euro currency symbol using a reg exp
in PHP.

I've set my web page to use charset=iso-8859-15 and tried

$allowed = "[^-a-zA-Z0-9.:,!+$ \\ ". chr(128) ."]";
if ( ereg( $allowed, $str) )
but the ereg regects any string containing the symbol.

Any help would be great,

Kevin
Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On 3 Dec 2003 09:32:56 -0800, km******@yahoo.co.uk (Kevin) wrote:
Hi, I want to check that a string entered via a from contains the only
cdertain characters including the Euro currency symbol using a reg exp
in PHP.

I've set my web page to use charset=iso-8859-15 and tried

$allowed = "[^-a-zA-Z0-9.:,!+$ \\ ". chr(128) ."]";
if ( ereg( $allowed, $str) )

but the ereg regects any string containing the symbol.


128 is not a valid printable character in iso-8859-15.
The code for Euro is 164.
http://en.wikipedia.org/wiki/ISO_8859-15

It's only 128 in Microsoft Codepage 1252.
http://www.kostis.net/charsets/cp1252.htm

--
Andy Hassall (an**@andyh.co.uk) icq(5747695) (http://www.andyh.co.uk)
Space: disk usage analysis tool (http://www.andyhsoftware.co.uk/space)
Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.