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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:55:45+00:00 2026-05-28T06:55:45+00:00

I have the following working code: $test = ‘123456’; $int = preg_match(‘/^\d+$/’, $test, $matches);

  • 0

I have the following working code:

$test = '123456';

$int = preg_match('/^\d+$/', $test, $matches);

print_r(array($int, $matches));

However when I execute it on codepad I get the error:

Warning: preg_match(): Internal pcre_fullinfo() error -3 on line 5

But the code is running on my own machine (and the code should be fine IMHO).

I need to distribute my code in the future so it would be bad if it would break depending on some config. So what is the reason codepad breaks on it?

  • 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-28T06:55:46+00:00Added an answer on May 28, 2026 at 6:55 am

    Code executed via codepad is running in a very restricted environment:

    Code execution is handled by a supervisor based on geordi. The strategy is to run everything under ptrace, with many system calls disallowed or ignored. Compilers and final executables are both executed in a chroot jail, with strict resource limits. The supervisor is written in Haskell.

    While it’s nothing you’d expect to break a regex engine it’s very possible that the pcre library uses something internally that is blocked by the codepad environment. No production system uses such severe restrictions so you should be safe to use that code in your application.

    The error code stands for “PCRE_ERROR_BADOPTION – the value of what was invalid”.
    However, the code in the PHP source where the error occurs is rc = pcre_fullinfo(pce->re, extra, PCRE_INFO_CAPTURECOUNT, &num_subpats); which uses a constant for what. So it clearly means that the pcre library is broken on codepad.

    If you wanted to be completely safe, you could write a small C program using libpcre to call that function on the same regex.

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

Sidebar

Related Questions

i have the following test code: #define CMDLINE .\\dummyFolder\\dummyProc.exe op1 op2 op3 int main(int
On a Solaris 5.8 machine, I have the following code: [non-working code] char *buf;
I have the following code and it's working (as usual) in everything but IE.
I have the following Clojure code and I'm not sure why it's not working:
Im trying to get debugging working without an app.config. I have the following code:
Any idea why the following code is not working mysql credentials are correct, have
I have the following code working with a DataGrid that has two column Column_A
I have the following test code (based on standard monodroid HelloWorld) namespace TestGREF {
I have the following sample test code public Stage Test(Stage Stage) { var StartStage
I have the following working 100% correctly. However to satisfy my curiosity... is there

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.