Question: I'm trying to write a regex in php to split the string to array.
The string is 

```
#000000 | Black #ffffff | White #ff0000 | Red

```

there can or cannot be space between the character and 

```
|

```

so the regex needs to work with 

```
#000000|Black #ffffff|White #ff0000|Red

```

For the second type of string this works.

```
$str = preg_split('/[\s]+/', $str);

```

How can I modify it to work with the first and second both strings?

Edit: Final output needs to be

```
Array ( [0] => Array ( [0] => #000000 [1] => Black ) [1] => Array ( [0] => #ffffff [1] => White ) [2] => Array ( [0] => #ff0000 [1] => Red) )

```

Answer: 
From <https://firebase.google.com/docs/android/setup> it looks like 16.0.4 is latest version

```
com.google.firebase:firebase-core:16.0.4

```
@Johns solution did not work for us as we ran into another known issue with that version (see <https://developers.google.com/android/guides/releases>)

What worked for us is to use the alias of firebase-core:

change `com.google.firebase:firebase-core:16.0.4` to

```
com.google.firebase:firebase-analytics:16.0.5

```