While solving a [UVa question](http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1135), I got this `String` and I need to split it an array of `String` removing `#` and `@`

`Brazil#2@1#Scotland`

I was getting a `ArrayOutOfBounds` exception when I used,

```
matchSummary.split("#@");

```

after researching solutions for this UVa question, I found that other experienced competitive programmers have done it like this, 

```
string.split("[#@]");

```

and this passes the verdict of online judge.

I cant get this `String` split for this aforementioned `String`

My complete solution for this question is available here- [see](http://codebloodedvalley.blogspot.in/2014/07/uva-10194-football-solution.html) 

Can anybody explain to me why my code worked with `split("[#@]");`?