Questions tagged [rlike]

For issues relating to the RLIKE synonym for the REGEXP MySQL operator.

RLIKE is a synonym for the REGEXP MySQL operator. It performs a pattern match of a string expression against a pattern. The pattern is supplied as an argument.

Sample:

SELECT 'Michael!' REGEXP '.*';
64 questions
1
vote
2 answers

how to search for specific whole words within a string , via SQL, compatible with both HIVE/IMPALA

I need to search a column(varchar) for specific whole words. I'm using the query below but not getting the desired results; select * from table1 WHERE upper(c.name) RLIKE ('FECHADO|CIERRE|CLOSED|REVISTO. NORMAL.') My problem is to…
user11311005
1
vote
1 answer

Hive rlike matching word boundary

I am new to Hive regex matching and struggling to find the right pattern for matching word boundaries: haystack RLIKE concat('(?i)\b', 'needle', '\b') doesn't return anything. Sample values which I have in DB: haystack --------- needless to…
deGee
  • 781
  • 1
  • 16
  • 34
1
vote
2 answers

How to search two strings followed by 4 digits in Hive SQL

I am trying to search for this pattern ab1234. I tried col like 'ab[0-9][0-9][0-9][0-9]' col like '(ab)[0-9]{4}' col like 'ab####' None of these are working. I checked this website https://www.w3schools.com/sql/sql_wildcards.asp, but it is not very…
Rachel Y
  • 13
  • 3
1
vote
1 answer

How to write fuzzy multiple substring matching when using RLIKE in Hive

For example: df.select('category').show() +---------------------------+ | category| +---------------------------+ | money,insurance| | life, housework| | game,FPS,network| | …
Bowen Peng
  • 1,635
  • 4
  • 21
  • 39
1
vote
3 answers

RLIKE expression giving 'mismatched input' error

I am querying a Hive table through Redash. I have a query similar to the following: SELECT CAST(id AS INT) as id, COUNT(sales) AS num_sales FROM sales_table WHERE id RLIKE '\d*' GROUP BY id I am trying to select only IDs…
KOB
  • 4,084
  • 9
  • 44
  • 88
1
vote
1 answer

How to use like/rlike to filter out string with space on either side

I'm trying to write a query to find strings where there is no space besides. Which means that 'xx applexx', 'xxapple xx' and 'xx apple xx' are not acceptable, but 'xxapplexx' should be queried out. I've tried select a from b where b.c not rlike…
1
vote
1 answer

CASE WHEN - LIKE - REGEXP in Hadoop Hive

I want to write a query in a hive Table using CASE WHEN, LIKE and a regular expression. I have used regexp and rlike, but I do not get the desired results. My attempts so far are the following select distinct ending from (select date, ending,…
user37143
  • 113
  • 4
  • 10
1
vote
2 answers

Extract rows from a table with regular expression hive sql

Please check the link for the result and table info. I need to query rows with value '343' in Col B with a regular expression . All columns are strings . Also please be kind enough to point any good learning materials in how to write good REGEX…
Charith Ellepola
  • 302
  • 2
  • 13
1
vote
2 answers

Does Postgres Support Rlike statment in jsonb columns type?

Does PostgreSQL support MySQL 'RLIKE' / Regexp statement in jsonb columns type ? for example, need a query which pull from the following table all ids which contains the value 'big': | data | | "id" :"bigData"…
khilo
  • 3,793
  • 1
  • 12
  • 11
1
vote
0 answers

Hive RLIKE on a list of strings

I have 2 tables, one with long string + int values, the other with short strings, i would like to match each row in table1 to NOT contain any value in table2 table1 values: 'i like my iphone now', 'iphone is great', 'this is also here' table2…
Ido Amit
  • 41
  • 1
  • 5
1
vote
1 answer

MySQL Where RLIKE any word of sentence

I have a table like this: +-------------+-------------------+----------------+ |id | column1 | column2 | +-------------+-------------------+----------------+ | 1 | apple iphone 6s | iphone | | 2 …
1
vote
2 answers

How to get all matching words except those in parentheses? Regex/Mysql

Here is the example I have: JELLY2some text some text{JELLY2}some textsome textsome text Sample text for testing: some textJELLY2 {some text JELLY2 lsdkfjsd}にsome text I want to get all JELLY2 except those in parentheses like: {JELLY2} and {some…
whitesiroi
  • 2,725
  • 4
  • 30
  • 64
1
vote
1 answer

Equivalency of RLIKE/REGEXP and LIKE - matching whole string vs. arbitrary substring

I have two queries. SELECT count(AlbumID) FROM album WHERE albumname like '%[%]'; Result: 15733 SELECT count(AlbumName) FROM album WHERE AlbumName RLIKE '.*\\[.*\\]'; Result: 15740 So as you can see like returns 7 elements less than rlike.…
Mike
  • 43
  • 1
  • 6
1
vote
1 answer

mysql LIKE and regex VS RLIKE and diacritics

I need to realize a little search engine. The problem is, that there are data inside the database that use instead of letters like ä ö ü the letters ae oe ue. I need a possibility to find them. I can do this easily with my regex-generator function: …
Bernhard
  • 1,852
  • 11
  • 19
1
vote
1 answer

same queries using 'regexp' gives different result in mysql

Basically, what I want, is to understand why select 'aa' regexp '[h]' returns 0 and select 'აა' regexp '[ჰ]' returns 1 ? check FIDDLE
bumbeishvili
  • 1,342
  • 14
  • 27