473,320 Members | 1,951 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Replace non US-ASCII chaacters in a string.

I need to replace all non US-ASCII characters.
What is the easiest way to do this?

sample code would be great.

"The PayPal website only accepts US-ASCII and 7 non-ASCII German
characters. The 7 characters are ä, ö, ü, Ä, Ö, Ü, and ß."
Jul 22 '05 #1
1 2066
Knud Russell Nex? wrote on 11 mrt 2005 in
microsoft.public.inetserver.asp.general:
I need to replace all non US-ASCII characters.
What is the easiest way to do this?

sample code would be great.

"The PayPal website only accepts US-ASCII and 7 non-ASCII German
characters. The 7 characters are ä, ö, ü, Ä, Ö, Ü, and ß."


Do a regex replace.

ASP-Jscript example:

myResult = myStr.replace(/[^a-zäöüß\d\s]/gi,'');

or

myResult = myStr.replace(/[^\u0001-\u007fäöüß]/gi,'');

not tested

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

Jul 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

19
by: rbt | last post by:
Here's the scenario: You have many hundred gigabytes of data... possible even a terabyte or two. Within this data, you have private, sensitive information (US social security numbers) about your...
8
by: Pret Orian | last post by:
I need to replace all occurancies of "is" in "This is a test (is), is, penis." with "<a href=is.htm>is</a>". The thing is, if I use a simple Replace function, the "is" in penis also gets replaced....
6
by: Shawn | last post by:
Hi. I have a form with a couple of text fields where users can enter some data. The data is stored in an access DB. the problem is that whenever a user enters " in a textbox some of the text...
6
by: Danny | last post by:
I need an asp command to strip out from a string all extra punctuation such as apostrophe, comma, period, spaces dashes, etc etc and just leave the letters. Can anybody give me some ideas? ...
3
by: mal_lori | last post by:
Hello, I have an ongoing problem with a single machine not recognizing the REPLACE function. This is a WinXP Pro machine, running Office 2000 (SP3) with MDAC 2.8 (SR1) and Jet 4 installed. ...
5
by: Jan Bares | last post by:
Hi, I have .NET 2003. When I run "Find in Files" command, everything works as expected. However when I run "Replace in Files" with the same settings a and press Find Next, I get: "Look in: A...
2
by: Øyvind Isaksen | last post by:
Hi! I use this function to show the text with linefeeds on my webpages: ----------------------------------- replace(myText,Chr(13),"<br>") ---------------------------------- This works...
2
by: john | last post by:
In a table I have text field A. I would like to replace all the null values in field A to a real value, let's say 'Test'. When I use Find & Replace and I search for 'is null' and I press replace or...
1
by: mlaw40 | last post by:
I am building a CMS driven website in php and I have a list of terms that for each page content I need to search for and replace with the following code: <a href=""></a> The problem I have is...
1
by: seanmatthewwalsh | last post by:
Hi I have a website that uses an Access 2003 database. I have controls on my pages that are bound to SqlDataSources that pull data from this database. In a couple of them, I need to use the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.