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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T16:07:25+00:00 2026-06-12T16:07:25+00:00

The below code works perfect on XAMPP on my PC, but does not work

  • 0

The below code works perfect on XAMPP on my PC, but does not work on my newly bought VPS. It crashed my code.

preg_match_all( "/$regex/siU" , $string , $matches , PREG_SET_ORDER );

This is expected to simply fetch links and titles from HTML.

Previously, a similar regex problem occurred today. Code was running fine on local server, but creating “Connection Was Reset” error on vps. The problem was caused by some commented html (having php code inside it) that was removed using the below code to optimize output, but even the problem of connection reset is resolved, HTML still has comments in browser source.

$string = preg_replace( '/<!--(.|\s)*?-->/' , ''    , $string );

So, problem is clear. These regex functions are not working fine. But i do not know the solution.

Can anyony help me in solving this.

Solved:

Thanks to https://stackoverflow.com/a/12761686/369005 @vimishor

  • 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-12T16:07:27+00:00Added an answer on June 12, 2026 at 4:07 pm

    Is known the fact that PCRE has sometimes a few problems with text larger than 200 lines. Developers from Drupal and GeSHi were hit by this problem in the past.

    References:

    1. Drupal PCRE Issue @ March 23, 2012
    2. GeSHi PCRE Issue @ February 02, 2012

    Maybe if you can split the text into small chunks (100 lines for example) and run regex on each chunk, may help.

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

Sidebar

Related Questions

hi my dear friends : the below code works perfect in ie9 , but
The code below works well but grabs only the UIView which is VISIBLE on
The code below works fine. But it seem clunky. How would you combine the
the code below works fine but it takes an absolute age to run. How
The code below works perfect for binding actual urls grabbed from the net. My
I customized UIAlertView (code is mentioned below). It works perfect except if uialertview (custom
I am using AJAX.NET's update panels in the below manner. My code works perfect
I have created a WebView programmatically. This works perfect. The code is below. What
The code below works perfect: @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Button
My below code works fine and is used to populate a <select> item with

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.