$re = '/(?ms)(RPA\s1:).+?Initiator\sID:\s(?<RPA1Initiator>[^ ]*)/';
$str = 'SITE_VPLEX:
RPAs:
RPA 1:
Version: 4.1.SP1.P1(h.167)
WAN IP: 000.000.000.000
RPA LAN IPv4: 000.000.000.000
RPA LAN IPv6:N/A
iSCSI interface IPs: None
Interfaces:
Type: FC
Initiator ID: 50012481006bexxx
Type: FC
Initiator ID: 50012481006bexxx
Type: FC
Initiator ID: 50012481006bexxx
Type: FC
Initiator ID: 50012481006bexxx
Hardware details:
Hardware type: Intel Corporation S2600GZ GEN5
Adapter type: 2564
Vendor: Intel Corporation
Hardware Serial ID: FC6RP133000229_00000000002_FFF
Hardware Platform: Intel Corporation S2600GZ GEN5
Amount of memory: 16269416 KB
Number of CPUs: 12
RPA 2:
Version: 4.1.SP1.P1(h.167)
WAN IP: 000.000.000.000
RPA LAN IPv4: 000.000.000.000
RPA LAN IPv6:N/A
iSCSI interface IPs: None
Interfaces:
Type: FC
Initiator ID: 50012481006bdxxx
Type: FC
Initiator ID: 50012481006bdxxx
Type: FC
Initiator ID: 50012481006bdxxx
Type: FC
Initiator ID: 50012481006bdxxx
Hardware details:
Hardware type: Intel Corporation S2600GZ GEN5
Adapter type: 2564
Vendor: Intel Corporation
Hardware Serial ID: FC6RP133000135_0000000000_FFF
Hardware Platform: Intel Corporation S2600GZ GEN5
Amount of memory: 16269416 KB
Number of CPUs: 12';
preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0);
// Print the entire match result
var_dump($matches);
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 PHP, please visit: http://php.net/manual/en/ref.pcre.php