Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7974089
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T08:16:26+00:00 2026-06-04T08:16:26+00:00

I have a problem where odd characters (from Word etc) are getting into a

  • 0

I have a problem where odd characters (from Word etc) are getting into a field in the database and then when I am showing that field it is showing spurious characters.

Is it possible with a RegEx to remove any non-ASCII characters? Obviously I want people to still be able to use any special characters like !@£$%^&*()_-+= etc just not non-ASCII characters.

If anyone could help that would be great!

Many Thanks!

Updated: This is in CLASSIC ASP.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T08:16:28+00:00Added an answer on June 4, 2026 at 8:16 am

    In order to do this task you will need to build up various regular expressions and execute them with a sub routine call before inserting your record into the database.

    Here is an excerpt from an explanation from 1stclassmedia.

    str = str.replace( /\s*FONT-FAMILY:[^;"]*;?/gi, "" ) ;
    str = str.replace(/<(\w[^>]*) class=([^ |>]*)([^>]*)/gi, "<$1$3") ;
    str = str.replace( /<(\w[^>]*) style="([^\"]*)"([^>]*)/gi, "<$1$3" ) ;
    str = str.replace( /\s*style="\s*"/gi, '' ) ; 
    str = str.replace( /<SPAN\s*[^>]*>\s*&nbsp;\s*<\/SPAN>/gi, '&nbsp;' ) ; 
    str = str.replace( /<SPAN\s*[^>]*><\/SPAN>/gi, '' ) ; 
    str = str.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi, "<$1$3") ; 
    str = str.replace( /<SPAN\s*>(.*?)<\/SPAN>/gi, '$1' ) ; 
    str = str.replace( /<FONT\s*>(.*?)<\/FONT>/gi, '$1' ) ;
    //some RegEx code for the picky browsers
    var re = new RegExp("(<P)([^>]*>.*?)(<\/P>)","gi") ;
    str = str.replace( re, "<div$2</div>" ) ;
    var re2 = new RegExp("(<font|<FONT)([^*>]*>.*?)(<\/FONT>|<\/font>)","gi") ; 
    str = str.replace( re2, "<div$2</div>") ;
    str = str.replace( /size|SIZE = ([\d]{1})/g, '' ) ;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an odd problem. I have a unit test that keeps getting stuck
I have an odd problem. I need to export Japanese characters from a table
I have an odd problem with Django. I have a set of objects that
I have an odd problem that is crashing my app, that I would like
So, I have an odd problem. I'm working with an SQLite database through javascript
I'm running into an odd problem with concatenating or printing strings. I have a
I have an odd problem that I just can't seem to diagnose, and it
I have an odd problem. I know that in Python, kwargs follow args, so
I have an odd problem. I'm trying to echo the response from a file
I have an odd problem. I have a number of C# apps that utilize

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.