Title: issue with a regex&#8230;
Last modified: August 22, 2016

---

# issue with a regex…

 *  Resolved [hero12](https://wordpress.org/support/users/hero12/)
 * (@hero12)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/issue-with-a-regex/)
 * hi,
    I have the following in some posts, and I need to remove it when the user
   visits the pages…
 *     ```
       '); galOpenCheck = true; } this.timerGallery = setTimeout(function () { jQuery( ‘#waitLoader’ ).remove(); jQuery( ‘.galleryoverlayer’ ).show(); jQuery( ‘#closeBtnGalleryTw’ ).show(); jQuery( ‘.ad-back, .ad-forward’ ).show(); jQuery(“#galleryContainer”).width( 950 ); jQuery(“#galleryContainer”).height( ‘95%’ ); jQuery(“#gallery”).css({‘width':’580px’}) jQuery( ‘#boxLateraleAdv’ ).fadeIn( 500 ); jQuery(“#galleryContainer”).css( {‘z-index':’2000′,’position':’absolute’ } ); jQuery(“#gallery .ad-image-wrapper, #gallery .ad-controls”).show(); jQuery(document).scrollTop( jQuery(“[name=’twittergallerylink’]”).offset().top ); _gaq.push([‘_trackEvent’, ‘galleryOpen’, ‘Individual’]); }, 3000);	/*	}	*/ },function (){ if(this.timerGallery){ clearTimeout(this.timerGallery); jQuery( ‘#waitLoader’ ).remove();} }); jQuery(‘#galleryContainer, .ad-back, .ad-forward,.ad-thumb-list a,.twittergallerylink’).click(function (e){ if(galOpenCheck != true) { jQuery(‘#galleryContainer’).append(”); galOpenCheck = true; } jQuery( ‘#waitLoader’ ).remove() jQuery( ‘.galleryoverlayer’ ).show(); jQuery( ‘#closeBtnGalleryTw’ ).show(); jQuery( ‘.ad-back, .ad-forward’ ).show(); jQuery(“#galleryContainer”).width( 950 ); jQuery(“#galleryContainer”).height( ‘95%’ ); jQuery(“#gallery”).css({‘width':’580px’}) jQuery( ‘#boxLateraleAdv’ ).fadeIn( 500 ); jQuery(“#galleryContainer”).css( {‘z-index':’2000′,’position':’absolute’ } ); jQuery(“#gallery .ad-image-wrapper, #gallery .ad-controls”).show(); jQuery(document).scrollTop( jQuery(“[name=’twittergallerylink’]”).offset().top ); _gaq.push([‘_trackEvent’, ‘galleryOpen’, ‘Individual’]); }); jQuery(document).click(function (e) { var container = jQuery(‘#galleryContainer, #closeBtnGalleryTw,.twittergallerylink’); if ((!container.is(e.target) // if the target of the click isn’t the container… && container.has(e.target).length === 0) || jQuery(‘#closeBtnGalleryTw’).is(e.target)) // … nor a descendant of the container { jQuery( ‘#closeBtnGalleryTw’ ).hide(); jQuery( ‘#boxLateraleAdv’ ).fadeOut( 100, function() { var widthResizedContainer = jQuery(“#galleryContainer”).css({width:’auto’}).width(); jQuery(“#galleryContainer”).width(widthResizedContainer); jQuery(“#gallery,#galleryContainer”).css({‘width':’380px’}); jQuery(“#galleryContainer”).css({‘z-index':’auto’,’position':’relative’}) jQuery(“#gallery .ad-image-wrapper, #gallery .ad-controls”).hide(); }); jQuery( ‘.galleryoverlayer’ ).hide(); galOpenCheck = false; } }); /* jQuery(document).mouseup(function (e) { var container = jQuery(‘#galleryContainer’); if ((!container.is(e.target) // if the target of the click isn’t the container… && container.has(e.target).length === 0) || jQuery(‘#closeBtnGalleryTw’).is(e.target)) // … nor a descendant of the container { jQuery( ‘.galleryoverlayer’ ).hide(); jQuery( ‘#closeBtnGalleryTw’ ).hide(); jQuery( ‘#boxLateraleAdv’ ).fadeOut( 100, function() { var widthResizedContainer = jQuery(“#galleryContainer”).css({width:’auto’}).width(); jQuery(“#galleryContainer”).width(widthResizedContainer); jQuery(“#galleryContainer”).css({‘z-index':’auto’,’position':’relative’}) jQuery(“#gallery .ad-image-wrapper, #gallery .ad-controls”).hide(); }); } }); */ /* setTimeout(function() {galleries[0].addImage(“images/thumbs/t7.jpg”, “images/7.jpg”);}, 1000); setTimeout(function() {galleries[0].addImage(“images/thumbs/t8.jpg”, “images/8.jpg”);}, 2000); setTimeout(function() {galleries[0].addImage(“images/thumbs/t9.jpg”, “images/9.jpg”);}, 3000); setTimeout(function() {galleries[0].removeImage(1);}, 4000); */ jQuery(‘#switch-effect’).change( function() { galleries[0].settings.effect = jQuery(this).val(); return false; } ); jQuery(‘#toggle-slideshow’).click( function() { galleries[0].slideshow.toggle(); return false; } ); jQuery(‘#toggle-description’).click( function() { if(!galleries[0].settings.description_wrapper) { galleries[0].settings.description_wrapper = jQuery(‘#descriptions’); } else { galleries[0].settings.description_wrapper = false; } return false; } ); }); } });
       ```
   
 * I tried this:
 *     ```
       '\);(.*)}\);
       ```
   
 * but when I tick the Regex checkbox, WordPress returns blank page.
 * Please help, thank you
 * [https://wordpress.org/plugins/real-time-find-and-replace/](https://wordpress.org/plugins/real-time-find-and-replace/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [hero12](https://wordpress.org/support/users/hero12/)
 * (@hero12)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/issue-with-a-regex/#post-5583244)
 * indeed, with any kind of regex… even with a simple word
 * or your regex option doesn’t work or is there something which does conflict when
   I enable the regex…but how to debug? thanks
 *  Plugin Author [Marios Alexandrou](https://wordpress.org/support/users/marios-alexandrou/)
 * (@marios-alexandrou)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/issue-with-a-regex/#post-5583785)
 * Regex rules need to start and end with a forward slash. This is typical with 
   regular expressions.
 * I would recommend starting with a very simple regex replace and once you have
   it working, start adding in wildcards and such. Regular expressions can be tricky!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘issue with a regex…’ is closed to new replies.

 * ![](https://ps.w.org/real-time-find-and-replace/assets/icon-256x256.png?rev=1347950)
 * [Real-Time Find and Replace](https://wordpress.org/plugins/real-time-find-and-replace/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/real-time-find-and-replace/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/real-time-find-and-replace/)
 * [Active Topics](https://wordpress.org/support/plugin/real-time-find-and-replace/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/real-time-find-and-replace/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/real-time-find-and-replace/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Marios Alexandrou](https://wordpress.org/support/users/marios-alexandrou/)
 * Last activity: [11 years, 4 months ago](https://wordpress.org/support/topic/issue-with-a-regex/#post-5583785)
 * Status: resolved