Regular Expression Problem

Homepage Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Regular Expression Problem

  • Creator
    Topic
  • #49854
    Deanna Norman
    Participant

    Hi,

    I am trying to use the regsub function to strip out the rtf formatting using the regular expression \w+|{.*?}

    The above regular expression works fine in a test app I wrote using .NET, but not in TCL. Can anybody see why? My statement is below:

    regsub -all \w+|{.*?} $OBX5 “” CleanOBX5

    I get no value in the variable $CleanOBX5

    Thanks,

Viewing 0 reply threads
  • Author
    Replies
    • #63883

      In tcl, it’s a good idea to wrap your regexps in braces.

      Code:

      regsub -all {…} $var1 {} var2

      Try this …

      Code:

      regsub -all {w+|{.*?} $OBX5 {} CleanOBX5

      I’m assuming your using the “|” as “or”. If not, you will need to escapte it with | like you did with the braces.

      Code:

      regsub -all {w+|{.*?} $OBX5 {} CleanOBX5

      -- Max Drown (Infor)

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

Forum Statistics

Registered Users
5,126
Forums
28
Topics
9,296
Replies
34,439
Topic Tags
287
Empty Topic Tags
10