# Matches FFMpeg inputs ^\s{0,}Input\s{0,}\# # An Input starts with the literal 'Input', followed by a space a number sign (?\d+) # Followed by an file number and a comma \,\s{0,}(?:(?[^\s\,]+)\,{0,}){0,} # Followed by container information (separated by commas) [\s\,]{0,}from # Followed by 'from' \s{0,}(?(?:''|\\'|[^'])*)' # Followed by the InputPath, in a single quoted string.