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

Re: [Clip] Re: alternative not regex syntax (was modify strip html preserveurls)

Expand Messages
  • Don - HtmlFixIt.com
    somewhere around here I have a curly braces and other such nonsense clip it runs a file and makes sure there are on curly braces and if not, do as you ask
    Message 1 of 2 , Nov 3, 2009
      somewhere around here I have a "curly braces and other such nonsense" clip
      it runs a file and makes sure there are on curly braces and if not, do
      as you ask below
      if yes, then advance to the next "funny character set" and try that one
      and so forth until I get a clean one ... when out of the fifteen or
      twenty choices, if still no love, then throw an error message and punt

      this is in a different context ... with returns

      ; find an odd character we can use for processing
      ; the odd character cannot appear in the file
      ^!Set %odd_character_count%="0"

      ; let's find an odd character not in the file ...
      ^!Inc %odd_character_count%
      ^!If "^%odd_character_count%" > "^%odd_character_delimiter0%" BADCONTENT
      ^!Find "^%odd_character_delimiter^%odd_character_count%%" CIWS
      ; if backtick present warn user and end
      ^!IfError NEXT ELSE Loop_Odd_Character

      ; replace all paragraphs with backticks
      ; because strip html will remove paragraphs otherwise
      ^!Replace "^P" >> "^%odd_character_delimiter^%odd_character_count%%" ACIWS

      ; strip out the html
      ;^!Select All

      ; reinsert the paragraphs
      ^!Replace "^%odd_character_delimiter^%odd_character_count%%" >> "^P" ACIWS

      Your proposal should work just fine ... but I really wanted to learn
      "not" regex.

      Axel Berger wrote:
      > "Don - HtmlFixIt.com" wrote:
      >> moving it from one html environment to
      >> another where mark-up is not needed
      > One of those, igitt. I think your other idea is easier:
      > ^!Replace "</a>" >> "{/a} WASI
      > ^!Replace other tags as wanted
      > ^!MENU Modify/Strip HTML Tags/Preserve URLs
      > ^!Replace "<http://(.*?)>" >> "<a href="http://$1">" WRASI
      > ^!Replace "{" >> "<" WASI
      > ^!Replace "}" >> ">" WASI
      > This assumes you do not use any curly braces anywhere. Replacing the URL
      > after the Strip HTML gets rid of all other attributes or classes that
      > may be present in the link.
      > Axel
    Your message has been successfully submitted and would be delivered to recipients shortly.