TCL question

Clovertech Forums Read Only Archives Cloverleaf General TCL question

  • Creator
    Topic
  • #55089
    Kevin Scantlan
    Participant

      I building a script that will filter messages based up the user in EVN.5  .  I want to delete all messages where the user ends with “$$XYZ”.  So basically, it boils down to creating a regular expression to will recognize that.  So, in the tcl environment, I created a user of ABC$$XYZ.  And I’ve tried several regexp commands with parameters such as:

      regexp “$$XYZ$” $user  , but that gives me a zero value.

      Also

      regexp  {$$XYZ}$ $user, which gives me an error

      Any ideas?

    Viewing 1 reply thread
    • Author
      Replies
      • #84047
        David Barr
        Participant

          regexp {$$XYZ$} $user

          The backslashes are needed by the regexp so that the dollars are treated literally, but if you just put it in quotes then TCL will remove the backslashes before passing the expression to regexp. I suppose you could do regexp “\$\$XYZ$” $user, but that’s just ugly.

        • #84048
          Kevin Scantlan
          Participant

            Thanks!  That worked.

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