Skip to content

Instantly share code, notes, and snippets.

@susannej
Last active May 9, 2017 14:05
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save susannej/a5af62395eb09650ea4de9058c8c0d19 to your computer and use it in GitHub Desktop.
Save susannej/a5af62395eb09650ea4de9058c8c0d19 to your computer and use it in GitHub Desktop.
BIC (Business Identifier Code / Bank Identifier Code) regex
// really, really, really simple - only regex based - bic check
// /(?i).../ is the java equivalent to /.../i
boolean bicCheck(String bic) {
bic ==~ /(?i)[a-z]{6}[a-z2-9][a-np-z0-9]([a-wyz0-9][a-z0-9]{2})?(x{3})?/ ? true : false
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment