~Escape characters etc. Please Help!

Discussion in 'JavaScript' started by RogerDodgr, Jun 8, 2009.

  1. #1
    This is a line of code from a javascript file. Long story short, it permits Drupal users to post php scripts to a forum without the WYSIWYG module altering it. In other word it protects the beginning and ending tags and everything in between <php?.......?>:
    FCKConfig.ProtectedSource.Add( /<\?[\s\S]*?\?>/g ) ;

    I highlighted the part I'm confused about in bold.
    I want a similar line of javascript code that that protects these two tags:
    • <code>
    • </code>

    I recognize the backslash as escape characters and the g as global, and the * is probably a wild card (I'm guessing). How exactly would <code>.....</code> be done? Don't worry about the function name if you have never seen it; it is a probably defined in this script.
     
    RogerDodgr, Jun 8, 2009 IP
  2. MMJ

    MMJ Guest

    Messages:
    460
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #2
    try simple?

    FCKConfig.ProtectedSource.Add( /<code>/g );
    FCKConfig.ProtectedSource.Add( /<\/code>/g );
     
    MMJ, Jun 8, 2009 IP