Yes, you can set it to be excluded using a regular expression (regex).
- Go to Settings > Library > Exclusions.
- Click on Excluded Video Patterns or Excluded Image/Gallery Patterns depending on the type of content you want to exclude.
- Click Edit.
- Enter a valid regex and click Confirm.
[!tip]
There is a useful site regex101 that can help you experiment and test with regex.
See Stash in-app documentation for some examples: