remove last .br with regular expression

Homepage Clovertech Forums Read Only Archives Cloverleaf Cloverleaf remove last .br with regular expression

  • Creator
    Topic
  • #47886
    Jennifer Schlender
    Participant

    Hi everyone,

    First, I wanted to thank the people that answered me a few weeks ago when I was having issues with my Xlate and concatentate/iterate for lab results. I got really busy and never replied back–my solution was pretty long and drawn out–but I got it fixed.  ðŸ˜€  So thank you for those that take the time to answer on this forum.

    I’m still working on lab results, and now I want a regular expression that will find the last .br in a line and simply remove it. I’m sure it’s simple, but I’m missing something.

    Thanks so much and happy Friday,

    Jennifer

Viewing 1 reply thread
  • Author
    Replies
    • #56990
      Robert Kersemakers
      Participant

      Hi Jennifer,

      Try this to remove the last .br from var1 and put the result in var2:

      Code:


      regsub -all {\.br\$} $var1 “” var2

      This will only work if the .br is the last string in the line! I think this will do, but if there is text after the last .br, you will need some more code…

      Zuyderland Medisch Centrum; Heerlen/Sittard; The Netherlands

    • #56991
      Jennifer Schlender
      Participant

      Robert,

      Thanks for the regular expression help. I had the $ in front of the \.br\, not behind it.  

      Jennifer

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

Forum Statistics

Registered Users
5,117
Forums
28
Topics
9,293
Replies
34,435
Topic Tags
286
Empty Topic Tags
10