Skip to main content

Locations With Wildcards

The locations that include paths may include wildcards through use of a special syntax in the URL.

The following table describes the wildcard conventions:

Description
?Matches a single character.
*Matches any sequence of characters.
**Recurses through subdirectories.

For instance, given the following keys in the S3 bucket s3://raw-tutorial/:

ls-example/file1.csv
ls-example/file2.csv
ls-example/file1.json
ls-example/jsons/file1.json
ls-example/jsons/file2.json
ls-example/jsons/not-json.csv

The code:

Location.Ls("s3://raw-tutorial/ls-example/*.csv")

Returns:

[
"s3://raw-tutorial/ls-example/file1.csv",
"s3://raw-tutorial/ls-example/file2.csv"
]

The code:

Location.Ls("s3://raw-tutorial/ls-example/**/*.json")

Returns:

[
"s3://raw-tutorial/ls-example/file1.json",
"s3://raw-tutorial/ls-example/jsons/file1.json",
"s3://raw-tutorial/ls-example/jsons/file2.json"
]