Looks like you won't be able to separate by linebreaks. You could try the below, which attempts to match a value from a comma separated list instead.
Query:
Code:
SELECT GROUP_CONCAT( `id` )
FROM `#__groupjive_groups`
WHERE `user_id` = '[user_id]'
GROUP BY `user_id`
The above gives you a comma separated list of group ids. Example expected results as follows.
10,21,31,41,51,61,71
You'd then need to use the below REGEX to match a value in the comma separated list.
Field: Custom > Value
Value: [cb_myqueryfield]
Operator: Is REGEX
Value:
Mode: Show
Note please see the regex in the attached file as forum security doesn't seam to like the pattern.