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

  • Home
  • SEARCH
  • 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 8690317
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T23:52:37+00:00 2026-06-12T23:52:37+00:00

So I recently opened a question and ended up solving it by using a

  • 0

So I recently opened a question and ended up solving it by using a regex. The regex I used essentially ate ALL my non-english characters.

Let me retry this:

I want to eat all non-keyboard characters that may exist in a string

the regex that I’m using is:

[^\\p{L}\\p{N}]

However this turns stuff like

10/10/2012 10:51:25 AM

into

10102012105125AM

Is there some way to easily exclude all alt-code characters from a string with replaceALL and leave keyboard characters like % / \ : and others intact?

Thanks!

  • 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-12T23:52:38+00:00Added an answer on June 12, 2026 at 11:52 pm

    You probably want to save only the ASCII characters. The character range [ -~] will achieve that. If you also want whitespace chars, you can add them in: [ -~\s].

    System.out.println(input.replaceAll("[^ -~\\s]+", ""));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This question appeared when I recently opened a rather old driver for my raid
Using Python, is it possible to get access to the Most Recently Used (MRU)
I recently asked a question about building a SOAP message using the java provided
Recently I opened a .dll file produced by Visual Studio 9 while compiling a
This is kind of a usability question for using VS2005: I have different branches
I have recently started using doc-view in Emacs, but I am having quite a
I've recently posted a new question in How jQuery can prevent reopening a new
After Eclipse starts I see only 4 recently opened files. Is it possible to
I recently simulated multiple login in PHP using 1 account. Here's what I did
I need to clear the recently opened documents history from Adobe reader in my

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.