rg "pattern" --glob '!**/*.yaml' # ! - exclude
# **/ - matches any directory depth
# *.yaml - any files ending with .yaml
Search for ''foo'' in in all files and subdirectories but ''legacy'' folder:
rg "foo" --glob '!legacy/**' # !legacy - exclude "legacy" folder
# ** - all files and subfolders