Evaluated proc sre_flags flags {set flags [join [uniq [split $flags {}]] {}]; if [regexp {^[igmx]*(?:-[s]*)?$} $flags] {split [string trim [string map $::re_flags $flags]]} {error "tcl regexp modifiers are limited to igmx-s (supplied: $flags)"}}