In Snowflake, the COPY INTO command can use regular expressions to filter specific files or extract parts of the data during data loading. You specify the PATTERN option with a regular expression to select files matching certain names or formats in your stage. For example:
COPY INTO my_table
FROM @my_stage
PATTERN = ‘.*data_2025.*.csv’;
This loads only files with “data_2025” in their names. Regular expressions can also be used with the FILE_FORMAT option to define how to parse and extract data from the file content, like handling delimiters or skipping headers.