<?php$input = "scripttruc.domainmachin.domain";if(preg_match_all('/\w+[.]domain$/m', $input, $matches)){ print_r($matches[0]);}?>
Standard input is empty
Array ( [0] => truc.domain [1] => machin.domain )
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!