Skip to content

Instantly share code, notes, and snippets.

@CuriousVini
Created December 20, 2019 19:33
Show Gist options
  • Select an option

  • Save CuriousVini/6b6078bcb861ccbf4623e40c9b634606 to your computer and use it in GitHub Desktop.

Select an option

Save CuriousVini/6b6078bcb861ccbf4623e40c9b634606 to your computer and use it in GitHub Desktop.
Pattern p = Pattern.compile("[a-z0–9._-]+");
if (!p.matcher(bucket).matches()) {
 collector.addFailure("Allowed characters are lowercase characters, numbers,'.', '_', and '-'", "Bucket name should only contain allowed characters.'").withConfigProperty("bucket");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment