Questions tagged [regexp-like]

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.

199 questions
-1
votes
1 answer

Oracle SQL Regexp

I have a , separated string values in two different columns and need to match a specific value between these two columns. Example: Column A: A123,B234,I555,K987 Column B: AAA1,A123,B234,I555,K987 I want to check the value B234 from Column A (which…
Bruce
  • 109
  • 8
-1
votes
1 answer

Oracle SQL Regexp capture only the number from the string

I am trying to extract the number from the row. i am trying this in Oracle 11G CREATE TABLE test1 ( COL_NAME VARCHAR2(100) ); insert into test1 values ('DWH_SCHEMA_BI.AB_25_BC_ORDER_STATUS'); select COL_NAME, REGEXP_REPLACE(COL_NAME,…
Data2explore
  • 452
  • 6
  • 16
-1
votes
3 answers

check if string has the format : 2 lettes au max following with numbers with regexp_like oracle

Could you please tell me the expression regexp_like to check if a string has the format which begins with one or two letters max followed by numbers. For example, like 'A25', 'AB567'. Thanks
ily
  • 1
  • 2
-1
votes
2 answers

Search for zero or one occurrence of word in SQL row

I want to search for the occurrence of words in a database row. I use SQLite as a database. The search needs to be case-insensitive. Let's say row x is Hello. Today is Monday and I want to search for Hello Monday Bye and still return the row x…
taraf
  • 777
  • 2
  • 10
  • 28
-1
votes
1 answer

why cannot match char of ']' with regexp_like in oracle?

When I input these SQLs, they return result 1: sql 1: select 1 from dual where regexp_like('R[23','^[[0-9a_zA-Z]+$'); returns 1 sql 2: select 1 from dual where regexp_like('[]','^\\[\\]$'); returns 1 But when I input this SQL, it cannot return…
WinLXY
  • 1
-1
votes
1 answer

PostgreSQL query to find a particular pattern in a text column

I have a text column in my database table which contains values like A/B A/B/C A/B/C/D A/B/C/D/E Now, I want to select only those rows where this column value contains maximum three occurrences of '/'. For clarity - expected output should…
Varshney P.
  • 208
  • 1
  • 12
-1
votes
1 answer

Matching beginning of line in oracle regexp_like

I am confused about support for ^ as beginning of line anchor in oracle. Below queries returns nothing: select 1 from dual where regexp_like('1000C', '^[\dA-Z]+$'); select 1 from dual where regexp_like('1000C', '^1[\dA-Z]+$'); Same queries without…
Pavan Kumar
  • 462
  • 5
  • 13
-1
votes
1 answer

The same Native query return different results when deployed in another Glassfish server

I have a web application that list some data. If I run in local (glasssfish 4.1 jdk 1.8 build 13) it returns me 11 rows. The same happens if I run the query direct on the database (11 rows). But after deploying the app on another glassfish server…
Liz Castillo
  • 59
  • 1
  • 9
-1
votes
4 answers

REGEXP_LIKE between number range

Can someone please finalize the code on the below. I only want to look for a 6 digit number range anywhere in the RMK field, between 100000 and 999999 REGEXP_LIKE(RMKADH.RMK, '[[:digit:]]') The current code works but is bringing back anything…
Mark Johnson
  • 91
  • 2
  • 8
-1
votes
1 answer

Case senstive search for alphanumeric values with Regexp_like plsql

i am trying to find a alphanumeric value in a column, which is case sensitive. I tried this pattern, but it is not working. `REGEXP_LIKE ('1000 - 2000 test', '^[0-9]{4} - [0-9]{4} test', 'c')` Or does case sensitive not work for alphanumeric…
Eli
  • 19
  • 1
  • 5
-2
votes
1 answer

Oracle sql with regexp based on hackerrank problem

i do this select distinct city from station where regexp_like(city,'^[^aeiou].*[^aeiou]$','i') and regexp_like(city,'^[^aeiou]\w+[^aeiou]$','i'); . it is wrong i know. but can someone explain to me where i am wrong at based on the question ? any…
-2
votes
2 answers

Oracle REGEXP_LIKE logical and matching of substrings in string

I have a string containing codes like 'code1 code2 code3'. It should return the string if all codes entered are contained in the string. For example: select * from ( select 'avs cde jkl' code from dual) where REGEXP_LIKE(code, 'REGEX-MAGIC') When…
-2
votes
1 answer

Query to split using Regexp data split not getting correct result oracle SQL

I am trying to classify the tables into various categories ,but i was not able to get the desired result , please check the below query results , existing results along with the expected results STANDARD NON_STANDARD TEMPORARY TO_BE_DROPPED SELECT…
Data2explore
  • 452
  • 6
  • 16
-2
votes
1 answer

How can i write check constraint

How can I write check constraint for one column say class_id where check condition should be: string started with CLS and followed by any 5 digit number. for e.g: CL100987, CLS45678
-2
votes
1 answer

Oracle SQL to list all occurrences of string in Clob/Blob Field

I have a field in my Oracle table "Table1" with Column "texta" which has all my codes written. I would like to extract all the occurrences which matches the patter "record." or "Record." and list the result. For example:- Content of…
Rohit Prasad
  • 135
  • 2
  • 12
1 2 3
13
14