use strict;
my $str = '(https://internetinthecar-e2e.iot.vodafone.com/sso/authorize/callback|https://internetinthecar-e2e.sfr.iot.vodafone.com/sso/authorize/callback|https://internetinthecar-e2e.a1.iot.vodafone.com/sso/authorize/callback|https://internetinthecar-e2e.swisscom.iot.vodafone.com/sso/authorize/callback|https://internetinthecar-e2e.proximus.iot.vodafone.com/sso/authorize/callback|https://internetinthecar-e2e.elisa.iot.vodafone.com/sso/authorize/callback|https://internetinthecar-e2e.tango.iot.vodafone.com/sso/authorize/callback|https://internetinthecar-e2e.telenor-no.iot.vodafone.com/sso/authorize/callback|https://internetinthecar-e2e.telenor-se.iot.vodafone.com/sso/authorize/callback|https://internetinthecar-e2e.yousee.iot.vodafone.com/sso/authorize/callback|https://internetinthecar-e2e.plus.iot.vodafone.com/sso/authorize/callback|https://internetinthecar-e2e.telia.iot.vodafone.com/sso/authorize/callback)
https://internetinthecar-e2e.bite-lv.iot.vodafone.com/sso/authorize/callback
internetinthecar-e2e.bite-lt.iot.vodafone.com
internetinthecar-e2e.a1-si.iot.vodafone.com
internetinthecar-e2e.cyta.iot.vodafone.com
internetinthecar-e2e.elisa-ee.iot.vodafone.com
internetinthecar-e2e.epic.iot.vodafone.com
internetinthecar-e2e.a1-hr.vodafone.com
internetinthecar-e2e.a1-bg.iot.vodafone.com
';
my $regex = qr/https://internetinthecar-e2e\.((sfr|a1|swisscom|proximus|elisa|tango|telenor-no|telenor-se|yousee|plus|telia|bite-lv|bite-lt|a1-)\.)?iot\.vodafone\.com/sso/authorize/callback|https://internetinthecar-e2e-new\.iot\.vodafone\.com/sso/authorize/callback/mp;
if ( $str =~ /$regex/g ) {
print "Whole match is ${^MATCH} and its start/end positions can be obtained via \$-[0] and \$+[0]\n";
# print "Capture Group 1 is $1 and its start/end positions can be obtained via \$-[1] and \$+[1]\n";
# print "Capture Group 2 is $2 ... and so on\n";
}
# ${^POSTMATCH} and ${^PREMATCH} are also available with the use of '/p'
# Named capture groups can be called via $+{name}
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Perl, please visit: http://perldoc.perl.org/perlre.html