Regex formed with rules:

1.Start with 1

2.End with b or B.

For Eg. 101b

OR

1. Can start with 0b or 0B
2. Then will have 1

For Eg. 0b1000101

```
Pattern patternForBin=Pattern.compile("(^(1)[0-1]*(b|B)$)");

```

This regex returns true with "101b" but when I tried same with `|`

```
Pattern patternForBin=Pattern.compile("(^(0b|B)1[0-1]*) | (^(1)[0-1]*(b|B)$)");

```

Why pattern didn't match?