blob: 8c6b80facf652cb3a93a8a49a2864eea3e049edc [file] [log] [blame]
Brian Osmand34c4a32017-12-06 13:26:38 -05001#!/usr/bin/env python
2#
3# Copyright 2017 Google Inc.
4#
5# Use of this source code is governed by a BSD-style license that can be
6# found in the LICENSE file.
7
Martin Vejdarskibeaaf472020-03-03 13:53:20 +07008from __future__ import print_function
9
Brian Osmand34c4a32017-12-06 13:26:38 -050010import os
Brian Osman5c548922017-12-11 14:59:03 -050011import re
Brian Osmand34c4a32017-12-06 13:26:38 -050012import sys
13
Brian Osman5c548922017-12-11 14:59:03 -050014dirpath = sys.argv[1]
15regex = re.compile(sys.argv[2])
Brian Osmand34c4a32017-12-06 13:26:38 -050016
Martin Vejdarskibeaaf472020-03-03 13:53:20 +070017print(sorted(filter(regex.match, os.listdir(dirpath)))[-1])