That's what test2.tcl in this [L1 ] "Regular Expressions" [L2 ] column does.
WLD - unfortunately the link, to zeus.itworld.com, appears to be long since dead.
Category GUI