Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Find & Replace using Regular Expressions

Featured Replies

I have over 3 thousand pages with the following script on the page:

 

<script type="text/javascript">

var dhtmlwin = null;

function openThumbnailLink(addr, winWidth, winHeight) {

dhtmlwin = dhtmlmodal.open('ETGfullsizeimagewindow', 'iframe', addr, 'Dianna Agron Photos',

'width=' + winWidth + 'px,height=' + winHeight +

'px,center=1,resize=1,scrolling=1');

dhtmlwin.onclose=function () {

dhtmlwin = null;

return true;

};

}

</script>

 

I just want to find this script on every page and replace it with a new script. Everything is exactly the same in the script on every page except for:

 

'Dianna Agron Photos'

 

which has a different name on every page.

Edited by riospace

  • Author

I have over 3 thousand pages with the following script on the page:

 

<script type="text/javascript">

var dhtmlwin = null;

function openThumbnailLink(addr, winWidth, winHeight) {

dhtmlwin = dhtmlmodal.open('ETGfullsizeimagewindow', 'iframe', addr, 'Dianna Agron Photos',

'width=' + winWidth + 'px,height=' + winHeight +

'px,center=1,resize=1,scrolling=1');

dhtmlwin.onclose=function () {

dhtmlwin = null;

return true;

};

}

</script>

 

I just want to find this script on every page and replace it with a new script. Everything is exactly the same in the script on every page except for:

 

'Dianna Agron Photos'

 

which has a different name on every page.

 

I am using Dreamweaver

  • Author

Got this answer and it worked great:

 

'([^']+)'

 

which should be all that's necessary. Unless-- shudder!-- those variably-named pieces sometimes contain a literal apostrophe. Then you have to go to a slightly more complicated rule involving \\ for the literal backslash where you escaped the literal apostrophe. (Read that sentence slowly ;))

 

:: thinking ::

 

{blahblah} 'John\'s Pictures' {blahblah}

 

'([^']+(\\'[^']+)*)'

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.