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
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
http://xenon.stanford.edu/~xusch/regexp/analyzer.html is a simple regex analyzer (among many others). Since its not linkable, here is just a screenshot and the link:

I believe you are looking for is the split() function:
What you mentioned about turning words into an array is typically referred to as a split, so if you wanted to get "otherword" from "facebox otherword", you would do the following:
var test = "facebox otherword"
var word = test.split(' ')[1];
Checks that the string contained in the rel property of this
If matched, the 1 or more word characters will be contained in a sub-match.