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 738127
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T07:48:03+00:00 2026-05-14T07:48:03+00:00

i want to filter a String by using the \w wildcard, but unfortunately it

  • 0

i want to filter a String by using the \w wildcard, but unfortunately it does not cover umlauts.

$i = "Die Höhe";    
$x = preg_replace("/[^\w\s]/","",$i);
echo $x; // "Die Hhe";

However, i can add all the characters to preg_replace, but this is not very elegant, since the list will become very long. ATM, i am preparing this only for German, but there are more languages to come.

$i = "Die Höhe";    
$x = preg_replace("/[^\w\säöüÄÖÜß]/","",$i);
echo $x; // "Die Höhe";

Is there a way to match all of them at once?

  • 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-05-14T07:48:03+00:00Added an answer on May 14, 2026 at 7:48 am

    You strings are obviously UTF-8, so you want the ‘u’ flag and unicode properties instead of \w

    $x = preg_replace('/[^\p{L}\p{N} ]/u',"",$i);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to split a string using a regular expression. Friday 1Friday 11 JAN
I have a datagrid that I want to filter based on a value selected
I want to implement some kind of sorting against my records, according to many
I have the following JSON string as part of a log line. cells :
I need the most efficient way to filter out Nodes from a XmlNodeList. The
I have a SQL query, mad in Python using Psycopg2 . The query reads
I have a SQLite database with cyrillic rows in it. For example: CREATE TABLE
1) I have a text file below like this. Dilantha code 65 po Bo
Basically , I am wondering if there is a handy class or method to
Here's my problem: I use Emacs and get lots of buffers that are pretty

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.