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
5
votes
1 answer

Regular Expresions queries with HSQLDB in Java

I am trying to create a regex filter for my app. I am using HSQLDB to store my messages and regex.pattern[1] class to match the incoming messages. I noticed that regex.pattern and LIKE in HSQLDB uses diferent matching "teqniques". Example I want to…
Manos Kirtas
  • 133
  • 1
  • 9
3
votes
1 answer

How to use RLIKE with Doctrine 2?

I'm using Doctrine 2 (Doctrine ORM 2.1, to be more precise) with MySQL and want to find entries, beginning with a number. With native SQL I would write something like: SELECT * FROM table WHERE name RLIKE '^[0-9]'; But when I try to do it with DQL,…
3
votes
1 answer

Hive Regex is acting greedy

I want to match only 911 or 1911 from a string with any number of preceding or ending * or #. My Regex: [^0-9]\*[1-9]{3,4}[^0-9]* Test code below returns true when i was expecting it to be false: select Digits from (select '*11911#' as Digits)…
usyed
  • 51
  • 1
3
votes
1 answer

How to use RLIKE/REGEXP patterns .* in MySQL

Question: Query the list of CITY names from STATION which have vowels (i.e., a, e, i, o, and u) as both their first and last characters. Your result cannot contain duplicates. I found an answer edited by @Mureinik, (thank you! it is very…
Claire Hu
  • 153
  • 1
  • 5
3
votes
2 answers

Join table using LIKE or RLIKE in Hive

I'm trying to (INNER) join two tables in Hive using RLIKE. select a.col_x, b.col_y, count(*) as n from tableA a join tableB b ON a.col_x RLIKE concat('^', b.col_z) group by a.col_x, b.col_y (tableA apprx. 100M records, tableB apprx. 1k…
nurandi
  • 1,588
  • 1
  • 11
  • 20
2
votes
1 answer

MySQL REGEXP acting with case sensitivity without BINARY mode?

I'm quite confused. I have a source string in the database; some HTML: "body": "\r\n
Nope no attachment

Floobinator
  • 388
  • 2
  • 11
2
votes
3 answers

Regex like telephone number on Hive without prefix (+01)

We have a problem with a regular expression on hive. We need to exclude the numbers with +37 or 0037 at the beginning of the record (it could be a false result on the regex like) and without letters or space. We're trying with this…
wmbff
  • 45
  • 4
2
votes
2 answers

How to escape single quotes in RLIKE Hive? Double single quotes not working

I would like to escape the single quote in RLIKE input. I used double single quotes like so: SELECT * FROM TABLE WHERE column RLIKE 'o''brien' But it returned the results with "obrien" rather than "o'brien". I tried "\\'" instead of double single…
Amelia
  • 33
  • 5
2
votes
1 answer

Use RLIKE in Mysql - with empty or all Values

Is there any way to use RLiKE in Mysql in order to get all records? I use this script: SELECT DISTINCT day FROM gestionsaasco WHERE month RLIKE ''; But this is the server answer: Got error 'empty (sub)expression' from regexp Note: I'm not use…
2
votes
0 answers

Regex for FQDNs works in Python but not with MySQL's RLIKE operator

I would like help formulating a regex which I can query MySQL5.6 with to get a list of hostnames which are in proper FQDN format. I found the following regex doing an online search which closely matches what I'm looking for…
skydive
  • 21
  • 2
2
votes
2 answers

Create subset with %like% operator

I'm looking for some help to create subsets using %like% operator in R. I have a table called 'pruebas1', which contains this information: scenario_name | land_consumption | land_consumption_pct Contención al 30% 692.00 …
2
votes
2 answers

What's the equivalent of mysql RLIKE operator in Hibernate Query?

I have the following query which runs perfectly in mysql. SELECT * FROM Orders as o, Products as p where o.productinfo RLIKE p.code; Here I am joining two tables Orders and Products with RLIKE. I am trying to implement the same in Hibernate. Query…
Sahal
  • 278
  • 2
  • 10
2
votes
2 answers

Using rlike in org.apache.spark.sql.Column

I am trying to implement a query in my Scala code which uses a regexp on a Spark Column to find all the rows in the column which contain a certain value like: column.rlike(".*" + str + ".*") str is a String that can be anything (except null or…
rgamber
  • 5,749
  • 10
  • 55
  • 99
2
votes
1 answer

Select MySQL tables ending in _timestamp with matching regxp

I'm trying to isolate some tables in a mysql database that match a pattern which can be described as some-name_10-digit timestamp eg: | oxseohistory_1381393508 | | oxseohistory_1382427650 | | oxseohistory_1382617597 | Is there a…
2
votes
1 answer

MySQL RLIKE behaviour for numbered string

I am using RLIKE to find some email domains with mysql. Here is the Query: SELECT something FROM table1 WHERE SUBSTRING_INDEX(table1.email, "@", -1) RLIKE "test1.com"|"test2.com" This matched all the email domains with numbers in,…
Milos Cuculovic
  • 19,631
  • 51
  • 159
  • 265
1
2 3 4 5