Questions tagged [regexp-substr]

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.

353 questions
0
votes
1 answer

Is there any way to add a unique identifier to every replacement that REGEXP_REPLACE performs?

I have a large text-CLOB that needs some converting done. A lot of the lines in my CLOB are preceded by a variable name in brackets like so: [VARIABLE_NAME_ONE] variable_one = 1 + variable_two; [VARIABLE_NAME_TWO] variable_two = 2 +…
J. Dough
  • 77
  • 7
0
votes
1 answer

problem with special characters in regexp funcion

I parse string in Oracle but names of providers have a special characters like '&' and '-'. And i can't handle with it. Could anyone help me ? SELECT arraylist.* , inserted.* FROM ( select trim(regexp_substr(str,'[^;]+', 1, level)) as str1 …
Kilro
  • 39
  • 1
  • 4
0
votes
2 answers

Using REGEXP_SUBSTR in Snowflake to pull multiple items around symbols including "("

I have an long string with the syntax 'item_name (price + tax), item_name (price + tax), item_name (price +tax)' that I want to get into the rows: item_1, price_1, item_2, price_2, etc. I used the below methods to get item_1 and item_2 but I can't…
0
votes
4 answers

regexp_substr all occurence of doc. XXX

Here a sample code: set define off; drop table brol; create table brol ( br varchar2(4000) ); INSERT INTO brol ( br ) VALUES ( 'Proposition de décret institutionnalisant l assemblée citoyenne et le conseil citoyen, déposée par Madame Schyns (Doc.…
0
votes
1 answer

String replacement based on condition in Oracle

I was working with some requirement where I need to display some data based on some certain condition. Below is the values I am giving here as a examples. The conditions are like If first 4 characters of the column is NUMERIC then it will further…
goldenbutter
  • 575
  • 2
  • 12
  • 25
0
votes
1 answer

regex parsing address to not include apt or suite at end

I have numerous addresses that I need to match against each other (mother/children) some addresses have apt, suite etc etc at the end of the line-Been trying to find ways to get entire line w/o that last part- with addy as (select '22 W JAMESTOWN ST…
0
votes
3 answers

Please help me with regexp_substr in snowflake

In snowflake below is the regex for seperating strings based on >> but when data is with space it is not doing so I mean it is taking partial value not compete value SELECT replace(REGEXP_SUBSTR( 'test1 >> test2 >>…
0
votes
1 answer

weird behavior of regexp functions in oracle 19c

I am not an expert in regexp, but as default should be case sensitive on. I try to figure it out why the regexp gives me the first 2 characters when the first one is capital select regexp_substr('JohnFoo','[a-z]{2}') from dual; the output is…
Pato
  • 153
  • 6
0
votes
1 answer

Javascript string search double and single quote using RegExp

I'm using the following code to search sub string in a string mystring.search(new RegExp(substring, 'i')) Reason why I am using new RegExp is, I want to search case insensitive. However, when there is a string like var mystring = '10" stick'; and I…
Julfikar
  • 1,353
  • 2
  • 18
  • 35
0
votes
1 answer

Oracle REGEXP_SUBSTR match words delimited by newline "\n"

I'm trying to split the string "SMITH\nALLEN\WARD\nJONES" in Oracle 10g by newline "\n" using a single SELECT query. Please help me to find the exact Regular Expression for this. Expected Output: 1 SMITH 2 ALLEN\WARD 3 JONES I have tried the…
Keshan Fernando
  • 347
  • 1
  • 4
  • 16
0
votes
2 answers

Split comma separated values with line gaps and nulls into columns in table via pl/sql procedure

I have a string, clob value in table which i need to split into columns . Source table query: Insert into disp_data(id,data) values(100, '"Project title as per the outstanding Requirements","The values are not with respect to the requirement and…
Velocity
  • 433
  • 5
  • 32
0
votes
2 answers

Oracle REGEXP_SUBSTR extracts strings by blank when there are multiple blanks

Hi I'm new to Oracle SQL, I want to extract LiIon Polymer from 6Cell LiIon Polymer. I use REGEXP_SUBSTR('6Cell LiIon Polymer', '\S+', 7) but it only returns LiIon
Osca
  • 1,588
  • 2
  • 20
  • 41
0
votes
1 answer

oracle regexp_instr in pl/sql doesn't work

I'm having a clob with pl/sql code inside. I have to check if there is no exit command inside at the end. So the following is not allowed: Some code ... exit Or Some code ... exit; Or Some code ... exit / But the following is allowed: Some…
nightfox79
  • 2,077
  • 3
  • 27
  • 40
0
votes
2 answers

How to get all the patterns from the column in Oracle Sql

Below is a text in a column: P348955: REMOVE NHA P210 PANEL PN : 6703ELM21 & REMOVE SUB ASSY PN: ELM2000-10-10 (ITEM 70) QTY 2EA & PN: ELM200-11-10 OR ALT (ITEM 75) QTY 1EA & PN ELM1057-1 QTY 1EA REQUESTED BY MMEECHAN REF ID 7369 I am looking to…
StackOne
  • 260
  • 2
  • 16
0
votes
1 answer

Parsing a dimension field with variable formatting in Teradata?

I have a dimension field that holds data in the below format. I am using teradata to query this field. 10 x 10 x 10 5.0x6x7 10 x 12x 1 6.0 x6.0 x6.0 0 X 0 X 0 I was wondering how should I go about parsing this filed to only obtain the numbers into…