Ignore:
Timestamp:
Mar 1, 2008, 11:54:44 PM (10 years ago)
Author:
raimue@…
Message:

port1.0/portutil.tcl:

  • Add a new function quotemeta, which can be used to escape strings for safe use inside regular expressions

port1.0/portlivecheck.tcl:

  • Escape any variable used inside ${livecheck.regex} using this new function

Closes #14067

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/src/port1.0/portutil.tcl

    r34552 r34667  
    20502050}
    20512051
     2052##
     2053# Escape a string for safe use in regular expressions
     2054#
     2055# @param str the string to be quoted
     2056# @return the escaped string
     2057proc quotemeta {str} {
     2058    regsub -all {(\W)} $str {\\\1} str
     2059    return $str
     2060}
     2061
Note: See TracChangeset for help on using the changeset viewer.