both of the patterns match so no the output will generally be the same however with the 1 that has the ?: in it, the pattern that is after the ?: will not be a part of the returned results.
as you can see test is not a part of the output in the 1st array. This is because the pattern that matched it was preceeded by the ?: (the 0 index is always the pull string that matched the whole pattern).
Some characters such as the ? have multiple meanings the ? can also be used to make something optional for example:-
"/([a-z])([0-9])?/"
That reg exp would quite happy return results for a, a1, b, b1 etc etc. The reason for it matching single letters as well is because the part of the regular expression that matches the number is optional.
"/([a-z])([0-9])/"
that on the other hand would only ever match a letter followed by a number as it is no longer optional.