Loading ...
Sorry, an error occurred while loading the content.

Re: [Clip] Need help with RegExpr for Find and Replace in Table attributes

Expand Messages
  • Don Daugherty
    ... Here are a few ideas, indicating the Clip commands you would want to read-up on in order to automate your task. To select the entire tag us
    Message 1 of 3 , Apr 16, 2006
    • 0 Attachment
      Wiz Feinberg wrote:

      >For example, here is a table tag that I need to alter:
      >
      ><TABLE height="100%" cellSpacing=0 cellPadding=0 width=650
      >align=center background=images/bg.gif border=0>
      >
      >In this instance I will need to remove the entire height attribute,
      >convert the background attribute to an inline style, and add a summary
      >attribute. I also want to make all attributes lowercase. The finished
      >tag would be like this:
      >
      ><table cellspacing="0" cellpadding="0" width="650" align="center"
      >style="background-image:url(images/bg.gif)" border="0" summary="Layout
      >table">
      >
      >On other tables I only need to add the summary to the end of the
      >attributes.
      >
      >
      Here are a few ideas, indicating the Clip commands you would want to
      read-up on in order to automate your task.

      To select the entire <table ...> tag us this:
      ^!Find "<table" IS
      ^!Select HtmlTag
      Having select the tag, you can perform the requred search/replace
      commands, for example
      ^!Replace "height=[^\s]+\s" >> "" RHIS
      Notes:
      1. The R indicates the use of a regular expression.
      2. The \s stands for a space;
      3. The cryptic construction [^\s] means any character BUT the space;
      4. The + means one or more instances of the preceding character.
      5. Thus the ^!Replace command looks within the selected text for
      "height=" followed immediately followed by one or more non-space
      character, such as "100%", and a space, and it replaces the combination
      with a null string ("").

      To add a summary at the end use something like
      ^!Replace ">" >> "summary="whatever is appropriate">" HS
    Your message has been successfully submitted and would be delivered to recipients shortly.