The Not Regexp expression returns all the records that do not match a pattern. The basic syntax is
Select <column_names> from <table-names> where <column-name> NOT REGEXP <pattern>
To filter our records that start with the pattern.
select * from film where title not regexp '^A';
To filter out records that end with the letter k, we do -
select * from film where title not regexp 'k$';
To filter out records with a particular length, we do-
select * from film where title not regexp '^.{10}$';
To filter out records with an either-or i.e. | operator, we do-
select * from film where description not regexp 'Awe-inspiring | Touching';
To get all such records that do not contain the characters between the square brackets, we do-
select * from customer where first_name not regexp '[A,D,B]'
order by first_name;