473,769 Members | 2,106 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

checking for Euro currency symbol in regexp

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
1 3863
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
25942
by: Robert Zierhofer | last post by:
hi there, it seems as if i can´t convert the euro and pound sign to their html equivalents. i tried eregi_replace("€", "€", $haystack); eregi_replace("£", "£", $haystack); as well as
11
12810
by: MH | last post by:
Thai may have been asked before but I'm new here.... How can I put the Euro symbol, ? using alt0128 in my page and get it validated as HTML 4.01 ? -------------- MH
18
6521
by: gabriel | last post by:
greetings, I am currently working on a website where I need to print the Euro symbol and some "oe" like in "oeuvre". If I choose this : <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" > <html
2
4635
by: tilmann | last post by:
We are using ASCII-Tablespaces with the Codepage 819 on z/OS. We're now having a problem with the EURO symbol. The data is inserted from a Windows-Client, running Codepage 1252. The Euro symbol is not part of the Codepage 819 which leads to a converting of the Euro Symbol to hex(1A) in the Database. On the Client, hex(1A) is returned which is different from the send hex(80). Is there any other codepage which is similar to Codepage 819, but...
0
1314
by: ashish | last post by:
hi All, Iam having a webapplication which when run under French culture info displays value of euro currency in this format 0.00 E, (E being the euro symbol, dont know how to type it here ) the issue is that currency in euro is displayed as E 0.00 instead of 0.00 E, Iam using following code ..
8
3674
by: Max | last post by:
My client has decided to use the Euro for the entire web site. Is there an easy way to get my ASP.NET app to format currency to Euro instead of US-dollar? Right now it's just reading the server settings, but I'd rather set this say at start up in the global.asax since other web sites running on the server may not share this setting. -Max
7
3323
by: kingski | last post by:
Any idea about this ? http://www.developerfusion.co.uk/forums/thread/114379/#114379 "Can any one help me as i am building a shopping cart and it supports multiple currencies but while sending confirmation mail o customer it does not show euro sign before amount he paid but it is showing a queston mark over there. It is working fine with Dollar sign and Pound Sign but this Euro is creating problem. " thanks.
2
3986
by: nagarwal | last post by:
Hi All, i am facing a very typical problem ..where i need to display the currency Euro symbol onto the jsp page. i could have done it using the java.util.Currency class but i cannot set the locale..b'coz it has to be an locale independent application, to i store the symbol itself in the db of all the currency avaliable...& need to show the one selected onto the jsp... i tried setting the "UTF8" encodings at the jsp & the jvm level too..but...
7
6501
by: brucedodds | last post by:
The system I support exists to generate invoices to send to European clients. Currency values in these reports must be represented as Euros with European conventions (comma for decimal; dot for thousands separator). Example: €123.456,78 We have been generating these by remoting in to a dedicated PC with its Windows Regional setting set to German. For various reasons we would much prefer not to have to do this. I've been trying to...
0
9589
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9423
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10216
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9997
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9865
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6675
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5310
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3565
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.