I need help doing a complex search and replace RRS feed

  • Question

  • I am terrible at writing regular expressions so I'm hoping for some help.  For years, I have used nifty player to post mp3 files of the sermons to my church's website.  So I have literally hundreds of instances of the nifty player that I want to convert to JW player.

    The code for the nifty is

    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="165" height="38" id="niftyPlayer208" align="" data="/SermonAudio/niftyplayer.swf?file=/SermonAudio/2012-07-01.mp3&amp;as=0">
      <param name=movie value="/SermonAudio/niftyplayer.swf?file=/SermonAudio/2012-07-01.mp3&amp;as=0">
      <param name=quality value=High>
      <param name=bgcolor value=#ffffff>
      <embed src="/SermonAudio/niftyplayer.swf?file=/SermonAudio/2012-07-01.mp3&as=0" quality=High bgcolor=#ffffff width="165" height="38" name="niftyPlayer208" align="" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">  </embed>

    and ideally, I want to grab /SermonAudio/2012-07-01 string, which changes weekly, and drop that into the JWPlayer string, which would look like this

    <script type="text/javascript">
        'flashplayer': '/js/player.swf',
        'id': 'playerID',
        'width': '225',
        'height': '24',
        'file': '/SermonAudio/2012-07-01.mp3',
        'controlbar': 'bottom'

    I have hundreds of instances of the nifty player that I want to replace and I really don't want to do it manually.

    Any help would be greatly appreciated

    • Edited by bradharris Saturday, July 7, 2012 6:02 PM
    Saturday, July 7, 2012 4:49 PM

All replies

  • Don't think of it as grabbing the file name and putting it in the new player code.

    Replace the old player code before the file name with the new player code before the file name.  Replace the old code after the file name with the new code after the file name.  Leave the file name alone.

    ... And make a backup copy of your local site before you start doing anything that will affect many pages and can't be undone.  Bulk find/replaces can't be undone.
    • Edited by KathyW2 Saturday, July 7, 2012 8:33 PM
    Saturday, July 7, 2012 8:32 PM