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
9
votes
18 answers

Query the list of CITY names starting with vowels (i.e., a, e, i, o, or u) from STATION

Query the list of CITY names starting with vowels (i.e., a, e, i, o, or u) from STATION. My answer/tried code is: select city from station where REGEXP_LIKE(city,'[^aeiou]+'); But it doesn't seem to be correct. Kindly help me with this.
Chaitanya Chawla
  • 91
  • 1
  • 1
  • 3
4
votes
3 answers

oracle regular expression to check string contains both alphabet and number and does not contain special characters

How to create an Oracle regular expression to check whether the given string contains both number and alphabet and does not contain special character. For example, if the string is like 'kjds327' it must return true if the string is 'dkfsdsf' or…
Nidheesh
  • 802
  • 1
  • 21
  • 44
3
votes
3 answers

RegExp Find and Replace ignoring part matches

I have a string formatted like: '(val$1,val$1,val$1,val$2,val$3,val$4,val$5,val$6,val$7,val$8,val$9,val$10,val$11,val$12)' and what I am trying to do is replace val$1 with some text e.g. XYZ Matching on just val$1…
dunkyduncs
  • 175
  • 1
  • 1
  • 8
3
votes
2 answers

How to do a negative lookahead in oracle regexp_like(), '?!' isn't working

Query: select 1 "val" from dual where regexp_like('ITEM HEIGHT','^(?!ICON).*HEIGHT$'); The above query doesn't return me 1. Please let me know how to achieve negative lookahead using oracle regexp_like(). Note: Please don't suggest any changes in…
user2907301
  • 71
  • 1
  • 6
3
votes
2 answers

Oracle Regular Expression to match US Phone Number Format

Oracle Regular Expression To match US Phone Number in the following formats only. (NNN) NNN-NNNN or NNN-NNN-NNNN or NNNNNNNNNN I have tried and came up to this : with test as ( select '(444) 123-6780' as testcol from dual union select '444123-6780' …
user2018441
  • 63
  • 1
  • 1
  • 8
2
votes
2 answers

ORACLE REGEXP limitation?

I'm testing oracle REGEXP_SUBSTR function and regexp that works in Python or Web testing tools like https://regex101.com/ doesn't work with…
2
votes
1 answer

Block Finder - Like Function

I have a large string (more than 255 char) called strBlockText. This string includes random text and block numbers. The block numbers should to be in the format ###Block####-## (IE: 245Block6533-56) but sometimes someone enters the wrong block…
reickmey
  • 65
  • 6
2
votes
4 answers

PL/SQL Regex search based on both characters and digits

I have a table TA which has a column inv_ref with has data as below. inv_ref ---------- MX/3280/20 CT/3281/20 CT/3109/20 MX/3272/20 RF/3275/20 My requirement is to fetch whereas middle 4 digit number of inv_ref between 3270 to 3299 also begin with…
Dilhan Nakandala
  • 301
  • 5
  • 24
2
votes
3 answers

alternative to below regular expression in snowflake

I am trying to use the oracle regular expression code in snowflake, but getting null value as result where as it is working as expected in snowflake. Requirement: Compare post code and return result if it matches the format. SELECT CASE WHEN…
2
votes
1 answer

Match only Words in a column with list of words

I have a table with Description where it can have multiple words, I need to compare with a set of words ( set of words are output from another query using LISTAGG function) to check if the word is existing in Description column or not. For example…
2
votes
3 answers

How to use REGEXP_REPLACE to check if a value 'Closed' is present in the string and replace

I have the below condition. Monday 8:30 a.m. to 6:00 p.m. <.br> Tuesday Closed <.br> Wednesday 8:30 a.m. to 6:00 p.m. Here Tuesday is Closed. So i need to exclude the below value from the string '<.br>Tuesday Closed' and generate as : Monday 8:30…
Tedgeor
  • 53
  • 1
  • 5
2
votes
2 answers

Select rows where first, last or both characters are special or punctuation, unless they only have a period at the end

I need to retrieve rows from my table which have names that start or end with a [:space:] or other special character [:punct:], excluding a single dot (.) at the end of the name. The idea is to pull names that are possible inconsistencies. Examples…
user11311005
2
votes
4 answers

REGEXP_LIKE for character at any position within substring of 5 characters

I have an old Access query which I'm trying to convert to Oracle SQL. Part of it looks at a string which can have a whole bunch of text and another part of the string is a series of five characters, e.g.: NNNNN What I'm trying to do is find where…
WSC
  • 903
  • 10
  • 30
2
votes
1 answer

regex to match 1 or two characters within a set, and ensure they're different

Okay gang, here's my conundrum: I'm looking to match a string using vanilla JavaScript's test(), a function of the RegExp prototype, to test an input variable inp: /{CONDITION}/.test(inp) The string must meet the following conditions: It can be…
ZenAtWork
  • 91
  • 1
  • 8
1
2 3
13 14