Name

lmatch — Look for elements in <list> that match <pattern>

Synopsis

lmatch (-exact | -glob | -regexp) ?list? ?pattern?

Description

Look for elements in <list> that match <pattern>. This command emulates the TclX lmatch command, but if TclX isn't available, it's a decent substitute.

In the following example a regular expression is matched against each element in the input list and a list containing the matching elements is returned

# lmatch -regexp lmatch -regexp { aaxa bxxb ccxxxxcc } {.+[x]{2}.+}
bxxb ccxxxxcc