while ( <> ) { m{ name:[\w\.\-\s]+ , version:(?:\+|-)?\d*\.?\d* , date:\d{2}/\d{2}/\d{2} }x or print "Does not match on line $..\n"; }