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

Re: Help with Regex Clip Code to find the following pattern....

Expand Messages
  • Paul
    Now that looks more like familiar procedural code. Thankyou, will be back on this soon. Paul
    Message 1 of 9 , Oct 11, 2010
    • 0 Attachment
      Now that looks more like familiar procedural code. Thankyou, will be back on this soon.
      Paul

      > Here's a possible take:
      >
      > ;Locate solo nested brace with its preceding and following stuff
      > :Brace
      > ^!Find "(?<={|\|)([\w\40]*+){([\w\40|]++)}((?1))(?=\||})" WRS
      > ^!IfError End
      > ^!SetArray %brace%=^$GetReSubStrings$
      > ;Get alternatives (at ^%brace2%)
      > ^!SetArray %alt%=^$StrReplace(|;";";^%brace2%;0;0)$
      > ^!Set %i%=0
      > :Alt
      > ^!Inc %i%
      > ^!If ^%i%>^%alt0% Repl
      > ;Edit the replacement string
      > ^!Append %repl%=^%brace1%^%alt^%i%%^%brace3%|
      > ^!Goto Alt
      > :Repl
      > ;Paste fixed alternatives and look for another case
      > ^!Set %repl%=^$StrDeleteRight(^%repl%;1)$
      > ^!InsertText ^%repl%
      > ^!Set %repl%=
      > ^!Goto Brace
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.