# If you'd like to omit non-matching lines from the result; add ';d' to the end of the expression.
sed -E 's/((CREATE.*my_table.*\n)|(\s+.*tinyint.*\n)|(\s+.*(?!tinyint)\n))/$2$3/g;t' <<< "CREATE TABLE `my_table` (
`id` bigint(20) NOT NULL,
`id2` bigint(27) NULL,
`REVTYPE` tinyint(4) DEFAULT NULL,
`REVTYPE2` bigint(52) blahblah,
`REVTYPE` tinyint(7) stuff
`some_other_column` varchar(255)
);"
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 SED, please visit: https://www.gnu.org/software/sed/manual/html_node/The-_0022s_0022-Command.html