$re = '/^(Primary|Secondary|Tertiary).Gene:.([A-Z]|[a-z])+ \(1\)/m';
$str = '1([A-Z]|[a-z])+
Scroll of Renaming (1)
Seller: Rogrinus
Expires in: 07 hr, 09 min, 46 sec
Selling price:
200000
1
Secondary Gene: Loop (Veilspun) (1)
Seller: Natta
Expires in: 09 hr, 21 min, 47 sec
Selling price:
200000
1
Primary Gene: Python (1)
Seller: PlatinumStardust
Expires in: 1 days, 07 hr, 37 min, 50 sec
Selling price:
200000
1
Primary Gene: Stitched (Veilspun) (1)
Seller: lizagem
Expires in: 2 days, 11 hr, 07 min, 56 sec
Selling price:
200000
1
Primary Gene: Stitched (Veilspun) (1)
Seller: ScarletCyanide
Expires in: 3 days, 06 hr, 31 min, 26 sec
Selling price:
200000
1
Tertiary Gene: Capsule (Veilspun) (1)
Seller: forcipiger
Expires in: 4 days, 04 hr, 15 min, 26 sec
Selling price:
200000
1
Tertiary Gene: Firefly (Veilspun) (1)
Seller: Pyracantha
Expires in: 4 days, 23 hr, 35 min, 53 sec
Selling price:
200000
1
Primary Gene: Python (1)
Seller: sisyo
Expires in: 5 days, 13 hr, 59 min, 20 sec
Selling price:
200000
1
Tertiary Gene: Squiggle (Banescale) (1)
Seller: BananaMeteor
Expires in: 5 days, 18 hr, 32 min, 31 sec
Selling price:
200000
1
Primary Gene: Skink (1)
Seller: H0ur
Expires in: 6 days, 13 hr, 07 min, 31 sec
Selling price:
200000
';
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