Oracle function that extends the functionality of the SUBSTR function by allowing searching a string for a regular expression pattern. See also REGEXP_INSTR, REGEXP_REPLACE, REGEXP_LIKE and REGEXP_COUNT for other functions extended to use regular expressions.
Questions tagged [regexp-substr]
353 questions
2
votes
3 answers
Regular Expression for REGEXP_SUBSTR in Oracle
I have the following text to search:
#S7Z OK
#Wed Feb 18 07:16:26 GMT 2015
expiration=10.0
lastModified=1424192425832
length=466472
path=/name/_master_/563/5638ad54-8079-4399-ba2b-3257b6e6c7fd.pdf
userType=
The words proceeding each = are the…

amishelli
- 91
- 1
- 7
2
votes
3 answers
how can extract part of a text from a field in mysql?
I have fields like this:
-----------------
id | name
-----------------
1 | name123
-----------------
2 | name
-----------------
3 | name456
-----------------
4 | name
I want to extract rows which…

MAli Fahimi
- 195
- 11
1
vote
1 answer
finding duplicate words throughout the text using regex
I wanted to find all sets of words that are repeated in a text. for example:
string21="we read all sort of books, we read sci-fi books, historical books, advanture books and etc."
Now regex should output these words: we,read,books
How can I get…

Avid Programmer
- 15
- 4
1
vote
2 answers
REGEXP_SUBSTR in Snowflake, regex that will extract the string after the period (which occurs between 0-2 times)
I'm trying to use the REGEXP_SUBSTR method in Snowflake to extract a string after the period. I have the following possibilities:
ALTER TABLE DATABASE_NAME.SCHEMA_NAME.TABLE_NAME ADD COLUMN ....
ALTER TABLE SCHEMA_NAME.TABLE_NAME ADD COLUMN…

kiwiLime
- 115
- 1
- 11
1
vote
1 answer
Specify the number of characters that should match a LIKE REGEX in T-SQL
I've done a ton of Googling on this and can't find the answer. Or, at least, not the answer I am hoping to find. I am attempting to convert a REGEXP_SUBSTR search from Teradata into T-SQL on SQL Server 2016.
This is the way it is written in…

WannabeDev
- 15
- 4
1
vote
2 answers
Snowflake regexp_substr to fetch folder name as a column from s3 bucket
Can someone help me fetch "Client name" using regexp_substr from below path in Snowflake. The client names here can have spaces or…

Sara
- 33
- 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
3 answers
How to split string words with regexp_substr in Oracle SQL?
select
regexp_substr('a-b--->d--->e f','[^--->]+',1,1) col1
,regexp_substr('a-b--->d--->e f','[^--->]+',1,2) col2
,regexp_substr('a-b--->d--->e f','[^--->]+',1,3) col3
,regexp_substr('a-b--->d--->e f','[^--->]+',1,4) col4
from…

CaptainX
- 21
- 3
1
vote
1 answer
Regex to find sub-string inside nested bracket followed by a specific string
I am trying to find all the top level 'except' clauses from the below string.
where (
param1 equals value1
and
param 2 equals valu2
except (
param3 equals value3
where (
param4 equals value4
except (
param6 equals value6
)
)
…
1
vote
1 answer
Oracle Regular Expressions - Replace all occurrence of string matching pattern
Using Oracle regular expression particularly regexp_substr and replace functions, I'm trying to find a way to replace strings that matches the pattern. To explain better, here's a sample data.
Hello $(KNOWN_AS),
Today is your lucky day.…

ads
- 1,703
- 2
- 18
- 35
1
vote
1 answer
How to extract specific string until blank space/next line from a text in Oracle?
I am trying to extract the following from the text field using Regrex in Oracle.
For example
"This is example,
and this really a example :h,j,j,j,j,
l //Updated question , as this letter is on the next line
now this is a disease:yes"
I am…

Rahul Rao
- 13
- 3
1
vote
2 answers
Oracle: Trying to split a string using REGEXP_SUBSTR, CONNECT BY LEVEL functions and getting duplicates
I have a table that has a column that holds an html string that may or may not be well formed (tried to use xmltable route and it didn't work) which is why I am trying to use the following sql syntax. I am trying to create a query that uses…

CreationSL
- 55
- 1
- 11
1
vote
1 answer
Extract string data between specific points in Oracle SQL
Example of Text:
PROCEDURE: Cryo balloon antral pulmonary vein
isolation and cavotricuspid isthmus ablation.
The patient is a middle aged and happy.
I am trying to extract "Cryo balloon antral pulmonary vein isolation and…

VRK
- 65
- 4
1
vote
4 answers
How to parse a specific part of string that starts with a specific str to the first space in Oracle
I have dataset like this:
SELECT
1 as text_id,
'The first is A.ACCOUNT_ID and the second one is B.IDENTITY_NO and third one is plate_number .' as full_text
FROM DUAL
UNION
SELECT
2,
'The first is ARC.PREV_RECORD and the second one…

Dilek Talebe
- 13
- 4
1
vote
1 answer
REGEXP_SUBSTR with a URL
I have a string in which I'm trying to extract a URL from. When I run it on this RegEx site, it works fine.
The Regex Pattern is: http:\/\/GNTXN.US\/\S+
The message I'm extracting from is below, and lives in a column called body in my SQL…
user6855566