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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T03:52:17+00:00 2026-05-24T03:52:17+00:00

Weird things happened when a website I am working on got moved to another

  • 0

Weird things happened when a website I am working on got moved to another server with newer version of PHP. The regex that was working normally on 3 other different servers refuses to work, returns 0 all the time.
This is the original regex:

/\A(?P<text>[[:alpha:]]{4})[[:space:]](?P<password>[\p{L}\p{N}]{3,})[[:space:]](?P<digit1>[[:digit:]]{2,4})[[:space:]](?P<digit2>[[:digit:]]{1,2})\z/u

password had to be unicode, before it was just [[:alnum:]] but there were some problems with clients.
And these are the ones I tried to no avail:

/\A(?<text>[[:alpha:]]{4}) (?<password>[[:alnum:]]{3,}) (?<digit1>[[:digit:]]{2,4}) (?<digit2>[[:digit:]]{1,2})\z/u
/\A(?<text>[\p{L}]{4}) (?<password>[\p{L}\p{N}]{3,}) (?<digit1>\d{2,4}) (?<digit2>\d{1,2})\z/u

Example text: ABCD 1a2b3c 100 50

All of these were tested on http://www.spaweditor.com/scripts/regex/index.php and worked perfectly.

Can anyone tell me what’s wrong with it? I know it might not be the prettiest regex you’ve seen but it works (or at least worked until now) just like expected. Right now I’m blaming the PHP (lol).

Edit: tested the last pattern on these sites:
* http://regex.larsolavtorvik.com/
* http://www.spaweditor.com/scripts/regex/index.php
* http://www.pagecolumn.com/tool/pregtest.htm
* http://lumadis.be/regex/test_regex.php
and on some others where it allowed to type my regex fully myself, with slashes and u flag.
In all of these websites it worked, but on some others I checked it didn’t, same as my server.

PCRE is unicode-enabled…

Edit: seems that sysadmins changed something after all… didn’t work until 10 minutes earlier :/ Somebody close this question, all of the regexes now work.

  • 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-24T03:52:19+00:00Added an answer on May 24, 2026 at 3:52 am

    You should check your PCRE extension version (phpinfo() -> PCRE Library Version). Some servers have < 8, and version >= 8 only supports unicode.

    Here is a good example on how to fix the problem on CentOS with PHP 5.2, you can check it with PHP 5.3 also.

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

Sidebar

Related Questions

I got a weird problem. I have a program that (does many things but
it's a really weird thing - i have a website that works perfectly in
I have a server hosting a website of mine that has almost zero-traffic. A
I've got a weird error in a couple MVC apps that I've not noticed
I must be asleep already or something because I'm seeing weird things. I've got
I've been working for a while on image processing and I've noticed weird things.
This is the most weird thing that has ever happened to me when programming
There seem to be a number of weird things one could do if one
This is pretty weird. I have my Profiler open and it obviously shows that
This is a really weird problem that I have been having. When I download

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.