Add support for extracting variables from a string