I would like to create a query where I select all records which contain characters that are not a-z or A-Z
so something like this
SELECT * FROM mytable WHERE REGEXP_LIKE(column_1, '![A-Z] [a-z]')
The REGEXP_LIKE scalar function returns a boolean value indicating if the regular expression pattern is found in a string. The function can be used only where a predicate is supported. The schema is SYSIBM. An expression that specifies the string in which the search is to take place.
Example - Match on end Next, let's use the REGEXP_LIKE condition to match on the end of a string. For example: SELECT last_name FROM contacts WHERE REGEXP_LIKE (last_name, '(*)n$'); This REGEXP_LIKE example will return all contacts whose last_name ends with 'n'.
The Oracle INSTR function is used to search string for substring and find the location of the substring in the string. If a substring that is equal to substring is found, then the function returns an integer indicating the position of the first character of this substring.
Oracle Database Implementation of Regular ExpressionsYou can use these functions in any environment that supports Oracle Database SQL. You can use these functions on a text literal, bind variable, or any column that holds character data such as CHAR , NCHAR , CLOB , NCLOB , NVARCHAR2 , and VARCHAR2 (but not LONG ).
The ^
negates a character class:
SELECT * FROM mytable WHERE REGEXP_LIKE(column_1, '[^A-Za-z]')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With