Oracle function similar to the LIKE condition, but REGEXP_LIKE performs regular expression pattern matching. See also REGEXP_INSTR, REGEXP_REPLACE, REGEXP_SUBSTR and REGEXP_COUNT for other functions extended to use regular expressions.
Questions tagged [regexp-like]
199 questions
2
votes
5 answers
Match at least 3 words in any order from some 5 words
I have a group of words:
"dog", "car", "house", "work", "cat"
I need to be able to match at least 3 of them in a text, for example:
"I always let my cat and dog at the animal nursery when I go to work by car"
Here I want to match the regex because…

Francis Eisenhower
- 25
- 7
2
votes
4 answers
oracle regex_replace to keep digit and backslash
I have excel file that contains some junk data in date field.
the date format is in 1/2/2015 format. I'm trying to load that file into a stage table in varchar field and apply regex replace function to clean up the bad data before loading to main…

user1751356
- 565
- 4
- 14
- 33
2
votes
1 answer
Regular expression metacharacter in SQL yields different results in Oracle vs. Postgres
I'm trying to convert some queries from an Oracle environment to Postgres. This is a simplified version of one of the queries:
SELECT * FROM TABLE
WHERE REGEXP_LIKE(TO_CHAR(LINK_ID),'\D')
I believe the equivalent postgreSQL should be…

geospatial
- 39
- 6
2
votes
2 answers
Oracle where condition search in a multiline string
I am trying to select the records thier 'Text' field match the following form:
____ xyz __ __
where __ means anything, and xyz represents the own word that I'm searching for.
Notice: the field 'Text' is a multiline string.
Here is the…

Ahmad Al-Khazraji
- 127
- 2
- 12
2
votes
3 answers
Oracle SQL: Searching for $ in Regexp
I want to search my response field to find any instance where a dollar sign $ is not followed by a numerical value. 1 or 2 spaces before a numerical value is ok, but there shouldn't be any text values following $.
I have the following query below:…

KellyB
- 21
- 1
2
votes
1 answer
Can we exclude match with few strings in oracle regexp_like()?
Background Knowledge:
We can't use (?!) to exclude, since, regexp_like() doesn't support negative lookahead.
I don't want to exclude using 'NOT REGEXP_LIKE()'
[^] can negate a single character only but not a string
Question:
Interested to know if…

user2907301
- 71
- 1
- 6
2
votes
2 answers
Match specific words in comma delimited string
I have a list of value that are allowed such as: the cat, the mouse, the dog, and the parrot.
Now I want to have the possibility to add many values from this list in a cell separated with semicolon (;).
That means I can add:
The cat; The dog; The…

van
- 29
- 6
2
votes
1 answer
regular expression for exact number in a numerical string
I have been trying to create a regular expression for the following problem:
A) PAR
B) 1234
given strings A and B above, i want to find all matches where those values occur in order regardless of white space, etc with the following important…

bob
- 31
- 1
- 2
2
votes
1 answer
sql - what does '^\d+\D+$' mean in regexp
I came through an expression -
select * from table where regexp_like(field, '^\d+\D+$');
I'm sure of what the expression does, but please can someone explain what '^\d+\D+$' refers to exactly?
Thanks.

Dipanshu Awasthi
- 115
- 1
- 2
- 14
2
votes
1 answer
PL/SQL to find Special Characters in multiple columns and tables
I am trying to come up with a script that we can use to locate any special characters that may exist in a column of data except for period, dash or underscore, and using variables.
My Data - Employees…

90mph
- 39
- 1
- 5
1
vote
0 answers
Postgres 13 regexp_match() returns null values
I'm reading a book about Postgres and there is an exercise with regex. So, I created table and loaded csv into it.
CREATE TABLE crime_reports (
crime_id bigserial PRIMARY KEY,
date_1 timestamp with time zone,
date_2 timestamp with time…

qwerty 1999
- 121
- 7
1
vote
2 answers
Substring before first uppecase word excluding first word
String contains words separated by spaces.
How to get substring from start until first uppercase word (uppercase word excluded)? If string start with uppercase, this word should included. Search should start from secord word. First word should…

Andrus
- 26,339
- 60
- 204
- 378
1
vote
1 answer
Oracle - How to find carriage return, new line and tab using REGEXP_LIKE?
I am trying to run a query in Oracle 11g where I am looking in a VARCHAR column for any rows that contain any of a carriage return, new line or tab. So far my code is as shown
select c1 from table_name where regexp_like(c1, '[\r\n\t]')
Not sure why…

rodneyc8063
- 113
- 8
1
vote
1 answer
REGEXP_LIKE() available in oracle but throws error when run on SQL Developer
Running the below code throws an error when run on SQL Developer:
SELECT REGEXP_LIKE('CTCP AYD 0404370713 M', 'CTCH.*[0-9]/{0,1}.*', 'i') FROM DUAL;
Error message:
ORA-00904: "REGEXP_LIKE": invalid identifier
00904. 00000 - "%s: invalid…

Rohit Singh
- 11
- 1
1
vote
2 answers
Oracle SQL: Using WHERE LIKE but for specific whole words / REGEXP_LIKE
I have a table of invoices with cost identifiers saved in a specific way, non always standard, like below:
ID | SYMBOL | COST_IDS
---+--------+-------------------
1 | FV01 | '1076219, 1081419'
2 | FV02 | '107621,123421'
3 | FV03 | '111521;…

Michał Moskal
- 143
- 2
- 10