Question: I thought this regex was about turning words into an array, but I get null as a result

when I want to get the second word from "facebox otherword" with array[0]

This is the regex:

```
this.rel.match(/facebox\[?\.(\w+)\]?/)

```

Thanks Richard

Answer: 
**I believe you are looking for is the** [**split()**](http://www.w3schools.com/jsref/jsref_split.asp) **function:**

What you mentioned about turning words into an array is typically referred to as a [split](http://www.w3schools.com/jsref/jsref_split.asp), so if you wanted to get "`otherword`" from "`facebox otherword`", you would do the following:

```
var test = "facebox otherword"
var word = test.split(' ')[1];

```

[**Working Demo**](http://jsfiddle.net/kqWn2/)
This matches text like:

```
facebox[.blabla]
facebox.blabla

```