$path = "L:\Lease Doc's\Track Lease Agreements\00770\/"; $that = preg_match('/[\\][0-9]{1,}[\\]/', $path, $matches); print_r($matches); PHP Warning: preg_match(): Compilation failed: missing terminating ] for character class at offset 15 in F:\jobs\DirecetoryCheck.php on line 21