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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T01:46:26+00:00 2026-06-01T01:46:26+00:00

I just stuck at this and cannot find solution. I would like to try

  • 0

I just stuck at this and cannot find solution.
I would like to try to transform a string to lower case using preg_replace.
I just cannot create the right regex.
The reason is that normal strtolower does not support unicode characters.
I know that I could use mb_strtolower but this function seems to be quite slow and beside them not everyone has MB support.

Any clue?

Regards,
Radek

EDIT: Ok, thanks alot for your help guys. I think my approach was not quite correct.
I think it would be much better to use this: How do I detect non-ASCII characters in a string? and then respectively use either the strtolower or mb_strtolower if available.

  • 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-01T01:46:28+00:00Added an answer on June 1, 2026 at 1:46 am

    Regex is not able to change characters by itself, it can only change their order and/or add additional characters/delete some of them.

    There is preg_replace_callback or /e flag, but they can manipulate only with known functions, and therefore can’t do better than strtolower.

    If you can’t rely on existense of mb_strolower function, you will have to implement it yourself.

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

Sidebar

Related Questions

I would like to thank contributors in advanced, I am rather stuck on this
i'm playing a little with Haskell and i'm stuck with this error, using the
I just saw this mentioned in Stack Overflow question Best WYSIWYG CSS editor and
This is my first post on Stack Overflow and I'm just wondering on the
Okay, this is just a crazy idea I have. Stack Overflow looks very structured
I am trying to do an app i just stuck with some logic in
I feel that it should be something very simple and obvious but just stuck
I am running a Grails application and it just gets stuck in the Configuring
I'm currently working on a very short project on Prolog, and just got stuck
Just learning Silverlight 4/RIA and i 'm stuck in a weird problem: setup an

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.