# expression. I.e., "@/...@.../" is valid. This lets users avoid
# excess quoting.
while true {
- regexp -- "^(\[^@\]*)(@(.*))?$" $str ignore prefix full_at at_text
+ regexp -- {^([^@]*)(@(.*))?$} $str ignore prefix full_at at_text
append result [string_to_regexp $prefix]
if {$full_at == ""} {
# No more substitutions, we're done.
}
} else {
# Match the usual forms.
- if {![regexp -- "^(\\.\\.\\.|\[A-Z\]\[A-Z_\]*|@|/\[^/\]*/)(.*)$" \
+ if {![regexp -- {^(\.\.\.|[A-Z][A-Z_]*|@|/[^/]*/)(.*)$} \
$at_text ignore at_text remainder]} {
error "invalid quotemeta expression @$at_text"
}
# Now replace any whitespace with a regular expression that will
# match any amount of whitespace. This is done after constructing
# the regular expression so we don't regexp-quote the \s+.
- return [regsub -all -- "\\s+" $result "\\\\s+"]
+ return [regsub -all -- {\s+} $result {\s+}]
}
# Define a new quotemeta substitution.
# RX is the regular expression that is used to implement the matching
# for this name.
proc define_quotemeta {name rx} {
- if {![regexp -- "^\[A-Z\]\[A-Z_\]*$" $name]} {
+ if {![regexp -- {^[A-Z][A-Z_]*$} $name]} {
error "bad quotemeta name"
}