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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T01:08:08+00:00 2026-06-06T01:08:08+00:00

Not sure if im just being stupid or something but here goes i work

  • 0

Not sure if im just being stupid or something but here goes i work for Shape5.com and i made there Vertex Framework the problem is Joomla keeps updating and this has popped up in our forums several times the error is Warning: preg_replace() [function.preg-replace]: Compilation failed: unmatched parentheses at offset 67

this is our code

<?php
$script = "Hello window.addEvent('domready', function(){ new Fx.Accordion($$('div#template-sliders-116.pane-sliders > .panel > h3.pane-toggler'), $$('div#template-sliders-116.pane-sliders > .panel > div.pane-slider'), {onActive: function(toggler, i) {toggler.addClass('pane-toggler-down');toggler.removeClass('pane-toggler');i.addClass('pane-down');i.removeClass('pane-hide');Cookie.write('jpanesliders_template-sliders-116',$$('div#template-sliders-116.pane-sliders > .panel > h3').indexOf(toggler));},onBackground: function(toggler, i) {toggler.addClass('pane-toggler');toggler.removeClass('pane-toggler-down');i.addClass('pane-hide');i.removeClass('pane-down');if($$('div#template-sliders-116.pane-sliders > .panel > h3').length==$$('div#template-sliders-116.pane-sliders > .panel > h3.pane-toggler').length) Cookie.write('jpanesliders_template-sliders-116',-1);},duration: 300,opacity: false,alwaysHide: true}); });";
$script = preg_replace("/window.addEvent('domready', function(){ new Fx.Accordion(.*?)}); });/", '', $script);
echo $script;
?>

the problem is the Fx.Accordion is forever changing depending on what template they use and this is really bugging me now sometimes it works sometimes it doesn’t ive tried escaping some all and none but still get the error the code above will reproduce the error exactly as we see it if anyone could help that be smashing.

Offset 67 is the last ) and yes ive tried escaping it removing it u name it ive tried 😀

I bet its something simple lol

Thanks Dave

  • 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-06T01:08:09+00:00Added an answer on June 6, 2026 at 1:08 am

    Parentheses are special characters in PCRE for capture grouping, which require escaping via backslash, as do the {} which would otherwise be range specifiers, and the dot ..

    $script = preg_replace("/window\.addEvent\('domready', function\(\)\{ new Fx.Accordion\(.*?\)\}\); \}\);/", '', $script);
    

    I think I have that all properly escaped. I assume the (.*?) was not intended to be a capture group. The ? is actually unnecessary in there because .* implies zero or more of any character.

    $script = preg_replace("/window\.addEvent\('domready', function\(\)\{ new Fx.Accordion(.*?)\}\); \}\);/", '', $script);
    //-----------------------------------------------------------------------Don't escape ^^^^^
    

    Update: If the (.*?) was intended as a nongreedy match group, then don’t escape it.

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

Sidebar

Related Questions

Not sure if I've just missed something but this doesn't work: $(this).children('td.threadtitle a').html('thread title');
I just made a transaction go through but not sure where there is a
Not really sure whats going on here, whether Im just being a fool or
I'm sure it's very simple and I'm just being stupid, but I've tried numerous
Not sure if I really am on the right forum, but if not, just
I'm not sure if it's just me, but whenever I open .txt files in
So, this may be a really stupid question, but I'm obviously missing something here.
Not sure if yall can help this time, as I'm just using this particular
I'm just starting to learn jQuery and I'm not sure how to enable a
I'm just learning C and am using xCode for it (not sure if it

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.