#!/usr/bin/perl -w while (<>) { if (/(?<=\')(.*\n?)(?=\'\))'\).should_have_properties\(\[\'(\S+)\'/gm) { print "$1 should have $2\n"; } if (/(?<=')(.*\n?)(?=\'\).property)'\).property\(\'(\S+)\'\)\.should_not_equal\(\'(\S+)\'\)/gm) { print "$1 property $2 should not equal $3\n"; } if (/'(\S+)\'\,\s+\S+\.property\(\'(\S+)\'\)\.(should_equal)\(\'(\S+)\'\)/m) { print "$1 $2 $3 $4\n my line"; } }