• As long as the file name is the only YYYYMMDDHHMMSS string in the file, I think you can just check for that pattern:

    SELECT input, SUBSTRING(input, PATINDEX('%[2][01][0-9][0-9][01][0-9][012][0-9][0-5][0-9][0-5][0-9]%', input), 14) AS extract

    FROM (

    VALUES('\\cc0dware01\BMF\RMS\REBATERATES-WORKING-2016ToEnd08-20160905180112.csv'),

    ('\\cc0dware01\BMF\RMS\REBATERATES-WORKING-2016ToEnd08-20160905180113.xlsx'),

    ('c:\20160905180113.')

    ) AS test_data(input)

    Edit: Added SQL code block.

    SQL DBA,SQL Server MVP(07, 08, 09) A socialist is someone who will give you the shirt off *someone else's* back.