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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T20:01:12+00:00 2026-06-10T20:01:12+00:00

I have a problem with the preg_replace function. In my code i will use

  • 0

I have a problem with the preg_replace function.

In my code i will use it to delete all chars that are not letters or numbers at the beginning of a string.

This works well, but when the $string contains iso-8859-1 character like ” è, ò, à, ù, é, ì ” there are considered not words, and all were removed.

preg_replace('/^[^a-zA-Z0-9]+/', '', $string);

ie. If $string contains èxample the output will be xample.

I need that these iso-8859-1 vowels are included.

Anyone have a solution to this?

  • 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-10T20:01:13+00:00Added an answer on June 10, 2026 at 8:01 pm

    PCRE does not support Unicode blocks (in which case things would be much easier), so you really have no option other than to specify the set of allowed characters (or its negation) manually. The regex would look like

    [^a-zA-Z0-9\xC0-\xFF]+
    

    The problem is that the range \xC0-\xFF also includes undesirable characters (e.g. the division sign, \xF7), so you have to break it down into acceptable subranges depending on your requirements. Look at the codepage layout to help decide which characters are OK and which are not.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a little problem with preg_replace . I need a function that removes
I have a block of code that will take a block of text like
I have a problem with the preg_replace function, I am trying to convert some
I have a little problem with some preg_replace functions in PHP. First I have
I have a problem with preg_match_all that maybe you can help. I have a
So... I have a problem with counting all ccurrences of preg_match and summing/addition first
I have problem SIMILAR to preventing form data reposting, but not quite the same
Hi guys I have this code that checks linkback: $reciprocal_linkback = reciprocal_linkback($contenturl,http://www.mydomain.com,1); if ($reciprocal_linkback==0)
i use nicEdit to write RTF data in my CMS. The problem is that
I have a problem regarding display PHP code (stored in a database) on a

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.