public static void deleteMatchingTempFiles(String namePattern) {

		Pattern pattern = Pattern.compile(namePattern);

		String tempPath = getTestDirectoryPath();
		File testTempDir = new File(tempPath);
		File[] oldFiles = testTempDir.listFiles((dir, filename) -> {
			boolean matches = pattern.matcher(filename).matches();
			return matches;
		});

		for (File file : oldFiles) {
			// deleteDir will also delete files
			FileUtilities.deleteDir(file);
		}
	}
Delete any files under the this test case's specific temp directory that match the give regex
{@link Pattern}

@param namePattern the pattern to match against the files
@see #deleteSimilarTempFiles(String)
Ghidra/Framework/Generic/src/main/java/generic/test/AbstractGenericTest.java