Strip out "***" from string

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Strip out "***" from string

  • Creator
    Topic
  • #52711
    Gary Atkinson
    Participant

      Trying to strip out the string *** from the NTE:3.  Using regsub, but its crapping out because the * is a special character right?  Does anyone have a suggestion on a different way to code this?

      Code:


      errorInfo:
      couldn’t compile regular expression pattern: quantifier operand invalid
         while executing
      “regsub -all — {***} $nte3 {} nte3”

      [/code]

    Viewing 4 reply threads
    • Author
      Replies
      • #75245
        James Cobane
        Participant

          Gary,

          Have you tried ‘escaping’ the asterisks; i.e. preceding each * with a  

          regsub -all — {***} $nte3 {} nte3

          Jim Cobane

          Henry Ford Health

        • #75246
          Gary Atkinson
          Participant

            I tried string map too, doesn’t error but doesn’t qualify either.  Here is an example string that contains the *** in which I want removed.

            Code:


            *** Preliminary Report ***.br\.brInterpreted by:   Elder,M.D. , David M.brTranscribed by:  JC     09/19/2011 14:19

          • #75247
            Gary Atkinson
            Participant

              yep that worked. thx  ðŸ˜†

            • #75248

              Gary Atkinson wrote:

              I tried string map too, doesn’t error but doesn’t qualify either.

              -- Max Drown (Infor)

            • #75249
              Jim Kosloskey
              Participant

                Gary,

                String map worked fine for me:

                string map

                  $myvariable

                  In the above case only occurrances of 3 asterisks will be replaced by null.

                email: jim.kosloskey@jim-kosloskey.com 30+ years Cloverleaf, 61 years IT – old fart.

            Viewing 4 reply threads
            • The forum ‘Cloverleaf’ is closed to new topics and replies.