msteveb / jimtcl

Official repository of Jim Tcl, an open-source, small footprint implementation of Tcl
http://jim.tcl.tk/
Other
445 stars 123 forks source link

expr: add support for =* and =~ #281

Open msteveb opened 1 year ago

msteveb commented 1 year ago

Adds glob match and regexp match operators to expr. e.g.

if {"abc" =* "a*"} {
  puts "matched glob" 
}
if {"abc" =~ "^a"} {
  puts "matched regexp" 
}

Is this useful enough to be included? Feedback welcome (Needs documentation before merging)

prpr19xx commented 12 months ago

I don't think it's useless, so it must be (at least somewhat) useful, so why not include it?