regsub

  • Creator
    Topic
  • #52382
    Bob Schmid
    Participant

      text is:

      DATE:  02/15/2011^^CHIEF COMPLAINT:  There is no complaint.^^HISTORY OF PRESENT ILLNESS:  There is no history of present illness.^^PAST MEDICAL HISTORY:  Negative past medical history.^^PAST SURGICAL HISTORY:  There is no past surgical history.^^FAMILY HISTORY:  There is no family history.^^ALLERGIES:  Negative.^^MEDICATIONS:  Too many to mention.^^SOCIAL HISTORY:  There is no social history.^^REVIEW OF SYSTEMS:  Review of systems are negative.^^^DD:        DT: 03/31/2011 11:21 A^1850977^CC:  JAMES J. ENYEART, M.D.||||||U|

      regsub  -all \^ $text “\.br\ ” newtext

      newtext = “.brDATE:  02/15/2011.br .br CHIEF COMPLAINT:  There is no complaint..br .br HISTORY……”  

      want to prevent the regsub from interpreting beginning of field in regsub

    Viewing 2 reply threads
    • Author
      Replies
      • #73990
        Scott Folley
        Participant

          How about just getting rid of the regsub altogether and using a string map:

          Code:


          set newtext [string map {^ \.br\} $text ]

          It is quick and does what you are looking for.

        • #73991
          Bob Schmid
          Participant

            Thanks!  will use string…..good idea

          • #73992
            Charlie Bursell
            Participant

              Good point Scott but no need to escape the “^”

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