You must find it in $found[2]
This contains all the captured matches, which are all the patterns that you have in parentheses.
- $ found [0] = full match
- $ found [1] = 1st expression [TRACK =
- $ found [2] = the entire URL where you have several subgroups: they will be formed after the following matches:
- $ found [3] = http or https
- $ found [4] = separator: //
- $ found [5] = subdomain
- $ found [5] = .youtube.
- $ found [6] = top level domain
- $ found [7] = path
- $ found [8] = close]
Obviously, you are using parentheses in a rather wasteful manner, since you are capturing data that you do not intend to use. You can use (?: ) As a way to group a template without capturing, for example. (?:http|https) matches http or https but doesn't commit it.
source share