Regular expression
Example of MATCH. CMake is a bit weird. The following example would match the file name without extension.
string(REGEX MATCH "(.+).c" match ${current_file})
if (NOT ${match} EQUALS "")
set (current_target ${CMAKE_MATCH_1})
endif()