The current ArcPy documentation for List functions (ListWorkspaces, ListFeatureClasses, etc.) only briefly mentions that the wildcard * represents “zero or more characters” and is case-insensitive. However, it does not explain how the position of the wildcard (start, end, or both) affects the results.
The example below demonstrates the difference between patterns '*.gdb', 'ALI_BIO*', and '*ALI*'. Adding such examples to the documentation would help users understand wildcard behavior and avoid confusion.
import arcpy
# Set the workspace
arcpy.env.workspace = r"C:\GIS\Projects"
# Example 1: Any item ending with .gdb
ending_gdb = arcpy.ListWorkspaces("*.gdb")
print("Pattern '*.gdb' matches:", ending_gdb)
# Example 2: Any item starting with ALI_BIO
starting_ref = arcpy.ListWorkspaces("ALI_BIO*")
print("Pattern 'ALI_BIO*' matches:", starting_ref)
# Example 3: Any item containing ALI anywhere
contains_tpt = arcpy.ListWorkspaces("*ALI*")
print("Pattern '*ALI*' matches:", contains_tpt)