I'm trying to figure out a regex which yields any string between single quotes ('), IF that string contains a given word.

For example, assume I have the following text, and I want to match everything between single quotes that contains the word "test":

```
Some sample text,
'this is test a match' and
'this is not a match' but
'this is a match again because it contains the word test'.
This "is not a test match because its double quotes".
And this is not a test match either because this is not encapsulated in quotes.

```

The regex would need to return two matches, namely

```
"this is a test match"
"this is a match again because it contains the word test"

```

I'm a bit lost here. I tried text.match( /'(.\*?)'/); to return everything between single quotes, and then subsequently have a function check for a substring match. But oddly that regex didn't even seem to return all strings within single quotes property.

Would greatly appreciate a pointer.. thanks!