http://www.perlmonks.org?node_id=686342


in reply to Re^3: Generate a truth table from input string
in thread Generate a truth table from input string

$str =~ s/(\w+)'/!$1/g; $str =~ s/\(([^\)]+)\)'/!($1)/g;