369 questions
0
votes
3
answers
88
views
Use REGEXP_SUBSTR in Oracle
I would like to extract a string from file name as below.
File name: L8_P0_TOPSIDE12_AA-MPS-K-PCE.JPG
Expected Output: AA-MPS-K-PCE
I am write my code as below butI cannot get what I expected. Need ...
0
votes
1
answer
33
views
REGEXP_SUBSTR assistance
This is probably pretty simple for most, but I'm just not great at regular expressions.
I have a set of strings with this type of format:
SYND_YAHOO_7BEST_RANKADDITIONS_268_2357425
So basically I ...
2
votes
1
answer
383
views
Using REGEXP or REGEXP_SUBSTR in an MariaDB query to extract all of the image source links
I'm trying to use REGEXP in an MariaDB 11.0.2 query to extract all of the image source links within the HTML and text of the field post_content that is in each row in wp_posts. I've looked at related ...
0
votes
1
answer
179
views
How to remove special character without knowing the type of special character?
I am using snowflake and I am parsing an email message for a certain field. I found that only 2 records have a whitespace in the front. I have used trim, tried various types of char replace (9,10,13,...
0
votes
1
answer
99
views
REGEXP_SUBSTR, REPLACE, and TO_NUMBER
I have two tables like this:
| MOVIE_ID | BUDGET |
|----------+-------------|
| 1904269 | $850,000 |
| 1809508 | NLG 800,000 |
| 1988471 | $40,000 |
| 2119404 | $3,266 |
| ...
0
votes
3
answers
133
views
Extract value between two strings in SQL
I'm trying to extract price for each day from a tag list in SQL Developer.
This is my list (I can use another list format if needed):
monday12monday, tuesday567.12tuesday, friday87friday
I'm looking ...
-1
votes
2
answers
1k
views
Extract everything between 2 strings in snowflake using regular expression
I have a json like below stored in col1 of a snowflake table table1 from which I want to extract the dump portion into a column dump in a snowflake table table2. I am trying to use regular expression ...
0
votes
2
answers
97
views
BigQuery - Extract substring from column
I have column let's say called "assets" with results looks like this
//bigquery.googleapis.com/projects/ABC/datasets/123
//bigquery.googleapis.com/projects/BlaBla-something/datasets/12345
/...
0
votes
2
answers
59
views
Substr instr help needed in sql oracle
i am trying to fetch some text from HTML string from a table. the text are like this and i am trying to get the output
ID,TEXT
1,<font face="Microsoft Sans Serif" size="8" color=...
0
votes
1
answer
203
views
regexp_substr in Oracle and Mysql
I executed the same statement in MySQL and Oracle, but they returned different results. Regular expression "/?" means to return zero or more "/", but why would MySQL return me a &...
0
votes
1
answer
430
views
How is the regex for extracting domain from URL constructed [duplicate]
I saw an SO answer here which has the SQL to extract domain from a URL in Redshift. I am very new to Regex. Is it possible to understand the answer step by step?
REPLACE(REGEXP_SUBSTR(url,'//[^/\\\,=@\...
0
votes
1
answer
52
views
Regexp instruction in SQL
After applying function GET_JSON_OBJECT(features, '$.field') I get the values:
{10:3,300:286}
{300:86}
{300:3,50:1}
How to get the value after 300 then?
Needed result is
286
86
3
0
votes
2
answers
184
views
REGEXP_SUBSTR with pipe delimiter giving unexpected results
For this data in a packed field:
ONE|TWO|THREE|FOUR|FIVE|SIX|SEVEN|EIGHT|NINE|TEN|ELEVENTHEBAND|TWELVE
I have this regexp:
REGEXP_SUBSTR(the_packed_field_column , '((|)([[:alpha:] ]*)(|))' , 1 , 1) &...
1
vote
1
answer
911
views
Sybase regexp, substr, instr function to split the string
I have the below data in a table.
row_num
desc
1
First Name/Last Name - Middle Name
2
FirstName/LastName - MiddleName
3
FirstName/LastName
I am looking for the desired output as below
row_num
desc_1
...
0
votes
2
answers
181
views
Returning a specific substring from ORACLE SQL string using REGEXP_SUBSTR
I am having a difficult time trying to return a specific section of string from a field (BSE.NOTES) using REGEXT_SUBSTR. For my query, I have a VARCHAR2 field with a specific text that I would like to ...
1
vote
2
answers
492
views
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 underscores
s3://student-com/student-to-employee/student1/...
-2
votes
1
answer
568
views
Extracting string between two characters in sql oracle database
I need to extract a string that will located between two characters, with always the same pattern
sample string:
A CRN_MOB_H_001 a--> <AVLB>
What is in bold AVLB is what I want to extract, ...
2
votes
1
answer
695
views
How to extract only numerics from string in PostgreSQL 8.0.2 Amazon Redshift
I only want the numeric part of this string column:
identity
student:1234
student:56
student:789
id:driver_license-111-AZ
id:learner_permit-222-NY
So that the output should be:
wanted
1234
56
789
111
...
1
vote
3
answers
488
views
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
,...
0
votes
1
answer
882
views
SQL WHERE clause to use multiple wildcards
I have to write a query to fetch rows for 100+ diagnosis codes. What can be an optimal SQL query ? Below are the details of what I have:
Table:
Diagnosis_Cd
Description
A00
Cholera
A000
Cholera due to ...
0
votes
2
answers
5k
views
How to Select a substring in Oracle SQL from and up to some specific characters?
i am using oracle sql. i would like to substr starting from characters XY0 and include 2 or 3 more characters until '-' sign in the string
These characters may be anywhere in the string.
Original
...
0
votes
1
answer
131
views
regex expression to include german characters
I have a string that looks like this:
{"id":"1","name":"simpleword","type":"test"},{"id":"123","name":"...
0
votes
1
answer
215
views
extract nested values as a list
I have a table with a column "TAGS". Each row in this column has a bunch of dictionaries separated by commas. It looks like this:
{
"id": "334",
"name": ...
1
vote
1
answer
61
views
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 ...
1
vote
1
answer
202
views
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.
<p&...